【发布时间】:2012-05-29 13:09:29
【问题描述】:
网址http://www.example.com/ 和http://www.example.com/index.html 都显示相同的网页。但搜索引擎将它们视为 2 个不同的网址。因此,页面排名存在分裂并影响 SEO。
我在网络搜索后得到的可能解决方案:
1.Use DirectoryIndex index.html in the .htaccess file.
这告诉搜索引擎http://www.example.com/ 和http://www.example.com/index.html 是相同的。
我面临的问题:.htaccess 文件中的 DirectoryIndex index.html 要求所有子文件夹也有 index.html 文件。前任。如果根目录中有一个文件夹“blog”,其中没有 index.html 文件,则 url "http://www.example.com/blog/" 抛出 index not found 错误。
2.using 301 redirect. Redirect http://www.example.com/index.html to http://www.example.com/
问题:重定向会增加加载时间。这不是一个好习惯。
请建议哪种解决方案更好?我怀疑第一个是否是解决方案。 另外,如果我必须重定向,将http://www.example.com/index.html 重定向到http://www.example.com/ 更好,反之亦然?
【问题讨论】:
标签: seo canonical-link