今天闲下来了,决定解决这个疑难杂症!于是我去复制了别人正常收录的 robots 内容,然后贴到 robots 插件中生成新的,结果发现在谷歌 sitemap 提交时依然提示全部被拦截!我勒个去,这明显说明问题出现在插件上了!但是使用插件生成了 robots,百度站长平台检测又是没问题的,真是纳闷!
于是重新去查 Rewrite 规则相关资料,并通过 UE 编辑器重建 httpd.ini 文件,新增了内容:
RewriteRule /robots.txt /robots.txt [L]
删除 robots 插件之后,发现可以访问自定义的 robots 了!以前 httpd 里面也有这条规则,就是不生效!难道是编码错了么?
重新编写 robots.txt 上传后,再到谷歌提交 sitemap,发现问题已解决:
至于效果,可能要等几天再去查看下收录情况了!
下面贴一下我的 httpd.ini 和 robots 内容,以供参考:
httpd.ini
[ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 RewriteCond Host: ^marsge.cn$ RewriteRule (.*) https://zhang.ge$1 [I,R] # Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP # wordpress weijingtai # For tag RewriteRule /tag/(.*)/page/(\d+)$ /index\.php\?tag=$1&paged=$2 RewriteRule /tag/(.+)$ /index\.php\?tag=$1 # For category RewriteRule /category/(.*)/page/(\d+)$ /index\.php\?category_name=$1&paged=$2 RewriteRule /category/(.*) /index\.php\?category_name=$1 # For sitemapxml RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] RewriteRule /robots.txt /robots.txt [L] # For file-based wordpress content (i.e. theme), admin, etc. RewriteRule /wp-(.*) /wp-$1 [L] # For normal wordpress content, via index.php RewriteRule ^/$ /index.php [L] RewriteRule /(.*) /index.php/$1 [L]
robots.txt
User-Agent: * Allow: /*.html$ Allow: /wp-content/uploads Disallow: /wp-admin Disallow: /wp-includes Disallow: /wp-content/ Disallow: /blogmap Disallow: /myfeed Disallow: /liuyan Disallow: /readers Disallow: /tougao Disallow: /page Disallow: /*/page* Disallow: /*comments Disallow: /bulletin* Disallow: /feed Disallow: /date/* Disallow: /*trackback Disallow: /tag/* Disallow: /*?* Disallow: /*? Disallow: /*.css$ Disallow: /*.js.$ Disallow: /*.php$ Sitemap: https://zhang.ge/sitemap.xml
robots 内容暂时先这样了,以后观察收录情况再来修改。
另外,不知道各位有没有设置过更新服务【WP 后台=>设置=>撰写】,在我搜索 robots 的时候看到了别人提供的博客更新通知列表,管它有没有用,先加上再说:
RPC 更新列表如下:
http://blogsearch.google.com/ping/RPC2 http://ping.baidu.com/ping/RPC2 http://rpc.pingomatic.com/ http://blogsearch.google.com/ping/RPC2 http://api.my.yahoo.com/RPC2 http://www.feedsky.com/api/RPC2 http://api.my.yahoo.com/rss/ping http://ping.feedburner.com http://www.zhuaxia.com/rpc/server.php http://www.xianguo.com/xmlrpc/ping.php http://blog.iask.com/RPC2 http://ping.blog.qikoo.com/rpc2.php http://rpc.pingomatic.com/ http://rpc.technorati.com/rpc/ping http://rpc.pingomatic.com http://api.feedster.com/ping http://api.moreover.com/RPC2 http://api.moreover.com/ping http://api.my.yahoo.com/RPC2 http://api.my.yahoo.com/rss/ping http://www.blogdigger.com/RPC2 http://www.blogshares.com/rpc.php http://www.blogsnow.com/ping http://www.blogstreet.com/xrbin/xmlrpc.cgi http://bulkfeeds.net/rpc http://www.newsisfree.com/xmlrpctest.php http://ping.blo.gs/ http://ping.feedburner.com http://ping.syndic8.com/xmlrpc.php http://ping.weblogalot.com/rpc.php http://rpc.blogrolling.com/pinger/ http://rpc.technorati.com/rpc/ping http://rpc.weblogs.com/RPC2 http://www.azfeeds.com http://www.blogsearchengine.com http://www.blogtopsites.com http://www.feedbase.net http://www.feedsubmitter.com http://www.fybersearch.com http://www.plazoo.com http://www.readablog.com http://www.rssfeeds.com http://www.rssmad.com http://www.rss-spider.com http://blo.gs/ping.php http://www.pingerati.net http://www.pingmyblog.com http://geourl.org/ping http://ipings.com http://www.icerocket.com http://www.weblogalot.com/ping