我希望重定向www.mysite.com/index.html
至
www.mysite.com/
但我不希望用index.html重定向所有地址
www.mysite.com/folder/index.html
至
www.mysite.com/folder/
因此,只需将第一个index.html页面重定向到站点的根目录.
Ulr*_*lha 10
将以下内容添加到www.mysite.com根文件夹中的.htaccess文件中
RewriteEngine On
RewriteBase /
# redirect html pages to the root domain
RewriteRule ^index\.html$ / [NC,R,L]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8639 次 |
| 最近记录: |