-1

目前在我的网站上,用户可以同时浏览

www.mysite.com/index.html
www.mysite.com (which actually returns index.html)

我希望一切都消除歧义,例如

www.mysite.com/index.html

或者

www.mysite.com

考虑到什么是最佳实践

  1. HTTP请求
  2. 搜索引擎优化

谢谢,ps如果除了SEO之外还有其他考虑,HTTP请求的数量,请告诉我。

4

1 回答 1

2

把这个放在你的.htaccess

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/ 
RewriteRule ^(.*)index\.html$ $1 [R=301,L]
于 2012-09-23T19:58:31.327 回答