2011-12-17 81 views
-3

www.mysite.com/我想重定向www.mysite.com/index.html重定向www.mysite.com/index.html与.htaccess文件

www.mysite。 COM/

,但我不希望与所有的index.html重定向的地址一样

www.mysite.com/folder/index.html

www.mysite.com/folder/

所以,只要将第一个index.html页面重定向到网站的根目录。

回答

3

以下添加到.htaccess文件中的www.mysite.com

RewriteEngine On 
RewriteBase/

# redirect html pages to the root domain 
RewriteRule ^index\.html$/[NC,R,L] 
的根文件夹