Forum Moderators: phranque

Message Too Old, No Replies

RewriteCond and RewriteRule multilingual

rewritecond, rewriterule, multilingual

         

ScubaMaster

5:32 pm on Apr 1, 2011 (gmt 0)

10+ Year Member



I have to adjust my website a bit. I try to get rid of _get parameters for my languages and decided to create some subdirs. Now I try to redirect the correct language to the right directory.

RewriteCond %{HTTP:Accept-Language} ^.*es.*$ [NC]
RewriteCond %{REQUEST_URI} ^(/|/index\.php)$ [NC]
RewriteRule ^(.*)$ [abc.org...] [R=301,NC,L]

RewriteCond %{HTTP:Accept-Language} ^.*en.*$ [NC]
RewriteCond %{REQUEST_URI} ^(/|/index\.php)$ [NC]
RewriteRule ^(.*)$ [abc.org...] [R=301,NC,L]

RewriteCond %{REQUEST_URI} ^(/|/index\.php)$ [NC]
RewriteRule ^(.*)$ [abc.org...] [R=301,NC,L]

Anyone got a clue.

jdMorgan

2:19 am on Apr 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a problem? What is the question?

The code can be made more efficient, but if you intend to redirect based on the Accept-Language header, the code you posted should work.

Jim