1
我有一個老域名可以稱之爲舊域名301重定向到新域名與.htaccess的通配符
example.com
我想要做的所有網頁的301重定向和它的主頁,
newsite.com
因此,例如
example.com/category/page.html
應該301重定向到
newsite.com/category/page.html
而且還
example.com should redirect to newsite.com
與WWW或加www
無論是我嘗試以下
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://www.newsite.tv/$1 [L,R=301,NC]
我的文件夾結構
index.html
.htaccess
當我進入網站時,無論是否使用通配符,它只加載index.html,而.htaccess重定向不起作用。
我也能modrewrite
任何人都可以引導我樹立正確的.htaccess這種情況。
謝謝!
您的評論「當我在現場去,無論是通配符與否,只加載的index.html」並不完全清楚。你能否澄清你在瀏覽器中輸入哪個URL,以及index.html文件加載到哪個網站?你是否被重定向到'newsite.com'或者你是否在'example.com'上? – Kay