2013-08-30 122 views
0

我有這段代碼,它將www.example.com?index.php?q=home & lang = en重定向到www.example.com/home。我想將其重定向到www.example.com/en/home。可能嗎?從GET參數重定向語言htaccess

RewriteEngine On 
RewriteBase/
RewriteRule ^(.*)$ index.php?q=$1&lang=$2 [L,QSA] 
RewriteRule ^([^/]*)(.*)$ $1[L,QSA] 

在此先感謝

回答

0

嘗試:

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([a-z]{2})/(.*)$ /index.php?q=$2&lang=$1 [L,QSA] 
+0

您好,感謝,但我不得不改變代碼到這一點:(。*)的RewriteRule ^([AZ] {2})/ $ /index.php?q=$2&lang=$1 [L,QSA] – dontHaveName

+0

@dontHaveName你說的對,我把它倒回 –

+0

,還有一個錯誤更改%在&網址:) – dontHaveName