0

我有这段代码,它将 www.example.com?index.php?q=home&lang=en 重定向到 www.example.com/home。我想将其重定向到 www.example.com/en/home。可能吗?

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

提前致谢

4

1 回答 1

0

尝试:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]{2})/(.*)$ /index.php?q=$2&lang=$1 [L,QSA]
于 2013-08-30T08:51:54.123 回答