在.htaccess中我看到如何重寫/index.html指向主域:使用HTACCESS重寫index.html並將http://site.com重定向到http://www.site.com
RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*\/index\.html?\ HTTP/
RewriteRule ^(.*)index\.html?$ "/$1" [R=301,L]
我也明白的.htaccess如何防止網站從WWW下被編入索引,沒有它
RewriteEngine on
rewritecond %{http_host} ^mycustomcloset.com [nc]
rewriterule ^(.*)$ http://www.mycustomcloset.com/$1 [r=301,nc]
但你如何在同一時間做兩?
換句話說,我想mycustomcloset.com和mycustomcloset.com/index.html都指向http://www.mycustomcloset.com。
也許這可以幫助http://stackoverflow.com/questions/1 5723942/rewriting-an-apache-redirect-rule/15724022#15724022 – ncm