Forum Moderators: phranque

Message Too Old, No Replies

.htacess rewriterule for multi language pages

         

timmy01

9:53 am on Apr 14, 2010 (gmt 0)

10+ Year Member



Hi,

im a noob when it comes to .htaccess settings
so i wonder if you help me out on this one...

i need a rewriterule for multi lingual website

lets say root is in english, (www.domain.com)
and i want to add lets say spanish

than i want the url to look like www.domain.com/es/
it must use the same file i am currently using for english

what should the rewriterule look like?

what i got so far is this:

RewriteRule ^([a-z]{2})/(.*)?$ /?lang=$1 [NC,L]

anyone who can help me out?
cheerz!

jdMorgan

10:20 pm on Apr 14, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The rule looks OK, except that you should not use the [NC] flag -- If the case of /es/ is wrong, then redirect the request to correct it.
But since the rule is basically OK, we need to know what seems to be wrong. Where is this code located, what URL did you test with, what were the results, what did you expect, and how did your test results differ from your expectations? Also, do you have any other tested and working rewriterules in the same file?

Jim