百度收录论坛的问题
今天查看了一下百度论坛收录协议,其中有一点
第三步:使用XML文件
请将XML文件命名为sitemap_baidu.xml上传到您网站根目录下,并保证文件所在的url地址能够被百度spider正常访问。例如,网站为post.baidu.com,则将xml文件上传至post.baidu.com/sitemap_baidu.xml
当百度spider发现了xml文件后,会根据上面提供的参数自动对xml文件进行更新,并抓取高质量的内容。
注意: 百度spider不保证一定能收录您提交的全部内容。
按照上面的说法对于论坛http://www.52otaku.com/,百度的协议路径应该为http://www.52otaku.com/sitemap_baidu.xml,而Discuz!NT的协议路径则是http://www.52otaku.com/tools/sitemap.aspx,这样一来百度的虫虫根本不会在上面爬,Discuz!NT对百度的优化形同虚设
知道上面问题的原因,我们可以有以下的解决办法:
第一种,把sitemap.aspx产生的内容复制保存一份到论坛的根目录,并命名为sitemap_baidu.xml
如果你有采用官方的UrlReWriter,则可以采用第二种办法
在UrlReWriter的配置文件里面加多一条规则:RewriteRule ^(.*)/sitemap_baidu.xml $1/tools/sitemap.aspx
本人建议用第二种办法,因为这样可以自动更新;
第二条的配置方法如下:
<configSections>
<!-- The <configSections> element must contain a <section> tag for the <RewriterConfig> section element.
The type of the section handler is RewriterConfigSerializerSectionHandler, which is responsible for
deserializing the <RewriterConfig> section element into a RewriterConfig instance... -->
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- Rules for Blog Content Displayer -->
<RewriterRule>
<LookFor>^(.*)/sitemap_baidu.xml</LookFor>
<SendTo>$1/tools/sitemap.aspx</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
</httpModules>
tips:这样配置后仍然访问不到正确的sitemap_baidu.xml,提示找不到网页,有朋友说原因是没把HTML的解析用 asp.net 的ISAPI来解析。
办法是在IIS\你的站点\属性\主目录\配置\映谢 加入一个和 aspx 页面的配置相同的扩展名项。注意“确认文件是否存在”不要勾选,否则会出现找不到文件。
现在终于看到了,据说这就是伪静态页面的做法。在添加RewriteConfig的过程中遇到了正则表达式的问题,以前忽视了正则表达式的作用,现在看来得补一下这方面的知识了,接下来的日子就是和baidu,google,alexa过招的时候了。大家拭目以待看我的个站http://www.52otuka.com/吧!
第三步:使用XML文件
请将XML文件命名为sitemap_baidu.xml上传到您网站根目录下,并保证文件所在的url地址能够被百度spider正常访问。例如,网站为post.baidu.com,则将xml文件上传至post.baidu.com/sitemap_baidu.xml
当百度spider发现了xml文件后,会根据上面提供的参数自动对xml文件进行更新,并抓取高质量的内容。
注意: 百度spider不保证一定能收录您提交的全部内容。
按照上面的说法对于论坛http://www.52otaku.com/,百度的协议路径应该为http://www.52otaku.com/sitemap_baidu.xml,而Discuz!NT的协议路径则是http://www.52otaku.com/tools/sitemap.aspx,这样一来百度的虫虫根本不会在上面爬,Discuz!NT对百度的优化形同虚设
知道上面问题的原因,我们可以有以下的解决办法:
第一种,把sitemap.aspx产生的内容复制保存一份到论坛的根目录,并命名为sitemap_baidu.xml
如果你有采用官方的UrlReWriter,则可以采用第二种办法
在UrlReWriter的配置文件里面加多一条规则:RewriteRule ^(.*)/sitemap_baidu.xml $1/tools/sitemap.aspx
本人建议用第二种办法,因为这样可以自动更新;
第二条的配置方法如下:
<configSections>
<!-- The <configSections> element must contain a <section> tag for the <RewriterConfig> section element.
The type of the section handler is RewriterConfigSerializerSectionHandler, which is responsible for
deserializing the <RewriterConfig> section element into a RewriterConfig instance... -->
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- Rules for Blog Content Displayer -->
<RewriterRule>
<LookFor>^(.*)/sitemap_baidu.xml</LookFor>
<SendTo>$1/tools/sitemap.aspx</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
</httpModules>
tips:这样配置后仍然访问不到正确的sitemap_baidu.xml,提示找不到网页,有朋友说原因是没把HTML的解析用 asp.net 的ISAPI来解析。
办法是在IIS\你的站点\属性\主目录\配置\映谢 加入一个和 aspx 页面的配置相同的扩展名项。注意“确认文件是否存在”不要勾选,否则会出现找不到文件。
现在终于看到了,据说这就是伪静态页面的做法。在添加RewriteConfig的过程中遇到了正则表达式的问题,以前忽视了正则表达式的作用,现在看来得补一下这方面的知识了,接下来的日子就是和baidu,google,alexa过招的时候了。大家拭目以待看我的个站http://www.52otuka.com/吧!