robots.txt
robots.txt文件是搜索引擎访问网站第一个要查看的文件。通过robots.txt文件搜索引擎可以确定哪些链接是搜索引擎可以访问的。哪些链接是不希望搜索引擎访问的。甚至可以告知允许哪些搜索引擎访问网站。相当于网站与搜索引擎之间的协议。在搜索引擎找到robots.txt文件后会以robots.txt来确定访问的范围。如果没有robots.txt文件。搜索引擎默认全部页面都是可以访问的。下面是我自己网站的robots.txt文件User-agent: *
Disallow:/api/
Disallow:/hapi/
Crawl-delay: 5
Sitemap: https://www.example.com/sitemap.xml
sitemap
sitemap文件就告诉搜索引擎网站有哪些链接以及链接的更新频率,sitemap可以为txt、html和xml格式
sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>sitemap.txt
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
>
<url>
<loc>http://www.example.com/test1/</loc>
<priority>0.3</priority>
<lastmod>2021-10-07</lastmod>
<changefreq>weekly</changefreq>
</url>
</urlset>
http://www.example.com/test1/sitemap.html
http://www.example.com/test2/
<!DOCTYPE html>
<head>
<title>网站地图</title>
<meta http-equiv="Content-type" content="text/html;" charset="UTF-8" />
<style>
body{font-family: Arial, "微软雅黑";font-size: 13px;}
ul, li{margin:0px; padding:0px; list-style:none;}ul{width:800px;margin-left: auto;margin-right: auto;}.title{width:800px;font-size: 18px;}.lks{float: left;padding-right: 15px;line-height: 30px;font-size: 16px;}
</style>
</head><body align="center">
<ul><li class="title"><h3>www.example.com网站地图:(2021-10-07)</h3></li>
<li class="lks">1、<a href="http://www.example.com/test1/" title="Example Domain" target="_blank">测试栏目</a></li>
</ul></body></html>
网友回复
DLNA与UPnP的区别和不同?
苏超自建抢票app,通过先预约再抽签化解高并发抢票?
python如何让给电脑在局域网中伪装成电视接收手机的投屏图片视频播放?
如何结合python+js如何自己的视频编码与加密播放直播?
python如何在电脑上通过局域网将本地视频或m3u8视频投屏电视播放?
腾讯视频爱奇艺优酷vip电影电视剧视频如何通过python绕过vip收费直接观看?
有没有可免费观看全球电视台直播m3u8地址url的合集?
有没有实现观影自由的免vip影视苹果 CMS V10 API的可用url?
python如何实时检测电脑usb插入检测报警?
如何判断真人操作的鼠标移动直线轨迹与机器操作的轨迹?