Forum Moderators: phranque

Message Too Old, No Replies

Small problem with htaccess file

         

nekhbet

8:05 am on May 6, 2008 (gmt 0)

10+ Year Member



Hi,
I have a website that I want to make in 2 languages (same script but depending on the source domain it loads the language file/templates), for this i have bought 2 domain xyz.com and xyz.ro and set up the .htaccess file like this :

<IfModule mod_rewrite.c>
RewriteEngine On
#for Romanian version
RewriteRule ^articol_(.*).html ....
//for English version
RewriteRule ^article_(.*).html .....
</IfModule>

The problem is that both rules work for both domains but I want them to work only for their specific domain.
How can I do this?

Thank you

Best wishes

Sorin

jdMorgan

1:16 pm on May 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use a RewriteCond to test the %{HTTP_HOST} variable for each rule, e.g.

RewriteCond %{HTTP_HOST} ^(www\.)?domain\.xyz
RewriteRule ^article_([^\.]+)\.html$ .....

Jim

nekhbet

1:33 pm on May 6, 2008 (gmt 0)

10+ Year Member



Ohh, that was the problem, I wrote only one for each bunch of rules.
Thank you so much Jum :D, it works perfectly now