2011-12-17 84 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] 
的根文件夾