0
我使用WPML来翻译我的Wordpress网站,我不想使用Jquery语言重定向但使用htaccess。htaccess语言重定向与手动语言选择器
http://example.com是默认EN版本
的问题是,当你重定向到/德/你不能手动导航到EN版本。
这里是我的代码
## Language Detection
#The 'Accept-Language' header starts with 'de'
#and the test is case-insensitive ([NC])
RewriteCond %{HTTP:Accept-Language} ^de [NC]
#If not already redirected
RewriteCond %{REQUEST_URI} !^/de/ [NC] # ADDED
#Redirect user to /de/ address
#sending 301 (Moved Permanently) HTTP status code
RewriteRule ^$ /de/ [L,R=301]
#For every other language use English
RewriteRule ^$ - [L] # MODIFIED