的index.php我有一個新的領域新的TYPO3網站。舊網站的所有重要頁面都指向他們的新對應頁面,我在.htaccess中添加了301個重定向。那些工作很好!
但是有些頁面與舊網站的URL完全相同,我無法爲(無限循環)添加單個重定向。例如/ contact /。當我訪問http://www.example-old.com/contact/時,頁面只是重定向到/index.php。爲什麼?
收藏
- 所有非www應該被重定向到www 從舊網站(作品)
- 其他域名應該被重定向到新的(作品)
- 介紹人應該被重定向到新域中的相同URL,除非手動301重定向到位。 (不工作)
當前設置
這是.htacess片段我的工作:
<IfModule mod_rewrite.c>
# Enable URL rewriting
RewriteEngine On
RewriteBase/
# Point old domain to new domain
RewriteCond %{HTTP_HOST} ^example-old\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^example-new\.com$ [NC]
RewriteRule ^(.*) http://www.example-new.com/$1 [R=301,L]
# Point idle domains to new domain
RewriteCond %{HTTP_HOST} ^/?(?:www\.)?example-01.nl [OR]
RewriteCond %{HTTP_HOST} ^/?(?:www\.)?example-02.de [OR]
RewriteCond %{HTTP_HOST} ^/?(?:www\.)?example-03.eu [OR]
RewriteCond %{HTTP_HOST} ^/?(?:www\.)?example-04.net [OR]
RewriteCond %{HTTP_HOST} ^/?(?:www\.)?example-05.org
RewriteRule ^(.*)$ http://www.example-new.com/$1 [R=301,L]
</IfModule>
我想盡組合,我能找到嘗試並得到這個工作。這裏可能會出現什麼問題?
多謝!
感謝您的回覆!我實施了建議的更改,但無法解決我的問題。正常重定向一切工作正常,但任何子頁面重定向仍然轉發到/index.php – Scopestyle
嘗試使用'%{REQUEST_URI}'而不是'/ $ 1' –
在兩次出現'/ $ 1'時添加了這個,沒有運氣: – Scopestyle