Domain based redirect to different PHP files via htaccess
Hello there. Here's the thing: I have two domains here [http://www.myproject.com and [http://www.myproject.com.br .. In my root folder i have all the stuff for my projects including two "indexes": "index-en.php" for english and "index.php" for portuguese.
Can i have some trick in htaccess that redirect my users to one of these files depending on domain? .. something like:
[http://www.myproject.com [OR] [http://myproject.com redirect to [http://www.myproject.com/index-en.php
and
[http://www.myproject.com.br [OR] [http://myproject.com.br redirect to [http://www.myproject.com.br/index.php
??
Sorry if this is a stupid question but im almost crazy looking for tutorials over the internet and i cant get something that works or some response if this is possible or just a stupid question .. Can someone please give me some direction? Maybe some solution with a conditional directoryIndex (I dont know if that's possible).
thanks a lot
Actually i have this in my .htaccess:
ErrorDocument 404 /404.php
<IfModule mod_rewrite.c>
#Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^myproject.com$ [NC]
RewriteRule ^(.*)$ http://www.myproject.com/index-en.php [R=301,L]
RewriteCond %{HTTP_HOST} ^myproject.com.br$ [NC]
RewriteRule ^(.*)$ http://www.myproject.com.br/ [R=301,L]
</IfModule>
This just does the "non www to www" - that works correctly