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>
网友回复
python如何调用openai的api实现知识讲解类动画讲解视频的合成?
html如何直接调用openai的api实现海报可视化设计及文本描述生成可编辑海报?
f12前端调试如何找出按钮点击事件触发的那段代码进行调试?
abcjs如何将曲谱播放后导出mid和wav格式音频下载?
python如何将曲子文本生成音乐mp3或wav、mid文件
python中mp3、wav音乐如何转成mid格式?
js在HTML中如何将曲谱生成音乐在线播放并下载本地?
python如何实现在windows上通过键盘来模拟鼠标操作?
python如何给win10电脑增加文件或文件夹右键自定义菜单?
python如何将音乐mp3文件解析获取曲调数据?