我正在处理多语言CMS,而且我遇到了htaccess代码。 我尝试使用lang HTTP_COOKIE重写URL,无论请求的URL是什么:
http://localhost/site/en/Admin/login.php(而不是http://localhost/site/Admin/login.php)
OR
http://localhost/site/en/Admin/default.php(而不是http://localhost/site/Admin/default.php)
但我希望不要被重定向到不存在的/ en /文件。
的.htaccess :
RewriteCond %{HTTP_COOKIE} lang=([^;]+) [NC]
RewriteRule ^(.*)$ http://localhost/site/%1/$1 [L]