我希望重定向www.mysite.com/index.html
至
www.mysite.com/
但是我不希望用index.html重定向所有地址,比如
www.mysite.com/folder/index.html
至
www.mysite.com/folder/
因此,只需将第一个index.html页面重定向到站点的根目录。
发布于 2011-12-17 23:15:51
将以下内容添加到www.mysite.com根文件夹中的.htaccess文件中
RewriteEngine On
RewriteBase /
# redirect html pages to the root domain
RewriteRule ^index\.html$ / [NC,R,L]
https://stackoverflow.com/questions/8545243
复制相似问题