舊網站重定向:
www.example.com(默認)htaccess的 - 重寫&沒有導致循環
新網站:
example.com(默認)
和一新的語言..
es.example.com
目前舊網站:
www.example.com/this-page.php
通緝的新網站(網址乾淨):
example.com/this-page
es.example.com/esta-pagina
到目前爲止,我有這樣的:
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule^http://%1%{REQUEST_URI} [R=301,L]
RewriteRule ^this-page/?$ this-page\.php?lang=$1
RewriteRule ^esta-pagina/?$ this-page\.php?lang=$1
**的$ _GET [ '郎']是內部產生取決於example.com或es.example.com是否擊中。
問題:
如何我還可以添加一個類似的重定向:
重定向301 /this-page.php http://example.com/this-page
...這不會造成死循環?
爲什麼你不能使用一個額外的RewriteCond爲evaulates的HTTP_HOST規則? – arkascha
@arkascha我重寫虛 - 你可以給我如何做到這一點的線索? – Leon