我想知道如果htaccess上的多個條目將工作的301重定向。htaccess 301多個文件的重定向
我看到的問題是舊的站點文件具有'html'擴展名,並命名爲不同的名稱,因此一個簡單的全局重定向將不起作用,它必須是每個文件名的一個規則。
本網站每天收到1000次訪問,所以需要注意不要懲罰搜索引擎。
RewriteEngine On
RewriteBase/
RewriteRule ^file1\.html$ http://www.domain.com/file1.php [R=301,NC,L]
RewriteRule ^file2\.html$ http://www.domain.com/file2.php [R=301,NC,L]
RewriteRule ^file3\.html$ http://www.domain.com/file3.php [R=301,NC,L]
RewriteRule ^file4\.html$ http://www.domain.com/file4.php [R=301,NC,L]
由於舊文件是html類型,PHP頭重寫將不起作用。
感謝您的文章。 – Codex73 2009-08-31 01:09:48