2013-10-03 32 views

回答

1

尝试在DOCUMENT_ROOT/.htaccess此代码对domain.com

RewriteEngine On 

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] 
RewriteCond %{QUERY_STRING} (?:^|&)lang=([^&]+) [NC] 
RewriteRule^http://%1.%{HTTP_HOST}%{REQUEST_URI}? [NE,R=301,L] 
+0

+1哦,你代表着火了这些天。好吧:) –

+0

对不起,它将我重定向到fr(lang)目录,但我不想在此目录上重定向。它应该像目前一样工作,就像我可以得到它$ _GET ['lang']并通过它。 – Raheel

+0

这是'domain.com/index.php?lang = fr'重定向到'fr.domain.com/index.php'是不是你想要的? – anubhava