Forum Moderators: phranque

Message Too Old, No Replies

Another subdomain mod rewrite thing.

         

adiulici01

9:56 am on Feb 5, 2009 (gmt 0)

10+ Year Member



Hi.. I kinda newbie with mod rewrite so maybe that's why i just can't get it..
How can i mod rewrite:
[en.example.com...] => http://example.com/?lang=en
?

jdMorgan

2:12 pm on Feb 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi adiulici01, and welcome to WebmasterWorld!

Please see this recent thread [webmasterworld.com] on the same subject.

The only difference is the "purpose" of the project, and you might want to name the "master subdirectory" mentioned in that thread to "languages" (or "lang", or similar) for clarity.

Please review our Forum Charter [webmasterworld.com], and post questions back here.

Thanks,
Jim

adiulici01

8:30 am on Feb 6, 2009 (gmt 0)

10+ Year Member



I read the thread you pointed me too, but it still doesn't work.
I've rewrote the code like this:

RewriteCond $1 !^ro/
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ^([a-z]([\-_]?[0-9a-z]+)+)\.example\.com
RewriteRule (.*) /$1?theLang=ro [L]

Should I enable something on my server to work, or?
P.S. I am using .htaccess

g1smd

9:26 am on Feb 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you got
RewriteEngine On
ahead of all that?