马上注册,结交更多好友,享用更多功能,让你轻松玩转合天下互动社区。
您需要 登录 才可以下载或查看,没有帐号?中文注册
x
网站使用wordpress搭建以来出现不少毛病,由于wordpress对win主机的兼容性不是很好,所以我就经常折腾折腾。
前一段时间安装了Baidu Sitemap Generator插件生成网站地图,但是一直处于无法显示该页面的状态下,今天花了一会儿时间终于折腾好了,现在把方法分享给大家。
网站地图谷歌的“/sitemap.html”与百度的“/sitemap_baidu.xml”在win主机下无法显示主要是伪静态配置httpd.ini存在问题,只需要在httpd.ini中添加两行代码即可。
代码如下:
- RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]RewriteRule /sitemap.html /sitemap.html [L]
复制代码
将以上两行代码添加在httpd.ini中,本站sitemap无法显示问题得到解决。
注意添加位置:
- # 3600 = 1 hour
- CacheClockRate 3600
- RepeatLimit 32
- # Protect httpd.ini and httpd.parse.errors files
- # from accessing through HTTP# Rules to ensure that normal content gets through
复制代码
以上两行代码不是添加在httpd.ini最下面,而是添加在以上代码之后。
参考事例:
- # 3600 = 1 hour
- CacheClockRate 3600
- RepeatLimit 32
- # Protect httpd.ini and httpd.parse.errors files
- # from accessing through HTTP
- # Rules to ensure that normal content gets through
- RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]RewriteRule /sitemap.html /sitemap.html [L]
复制代码
经过以上对httpd.ini配置文件的修改本站google与百度的Sitemap显示正常。 |