DSchragg Posted July 27, 2010 Share Posted July 27, 2010 Hello Everyone, this is my first post on this great and very useful site. I'm hoping someone can give me a quick and simple answer for this one..... Here's my scenario: I have 2 domain names that point to one website. One domain is english the other french. I want an index.php file to handle what index file is loaded. If the user types in french.com I want it to load the index_french.html file, if the user types english.com I want the site to load index.html Sounds simple enough, but I may be wrong? Thanks in advance for your help. Quote Link to comment Share on other sites More sharing options...
trq Posted July 28, 2010 Share Posted July 28, 2010 This would be much better off being handled via mod_rewrite not php. Something like: RewriteCond Host: (?:www\.)?french\.com RewriteRule (.*) french_index.php?p=$1 [i,L] RewriteCond Host: (?:www\.)?english\.com RewriteRule (.*) english_index.php?p=$1 [i,L] Quote Link to comment Share on other sites More sharing options...
DSchragg Posted July 28, 2010 Author Share Posted July 28, 2010 This would be much better off being handled via mod_rewrite not php. Something like: RewriteCond Host: (?:www\.)?french\.com RewriteRule (.*) french_index.php?p=$1 [i,L] RewriteCond Host: (?:www\.)?english\.com RewriteRule (.*) english_index.php?p=$1 [i,L] Wow, that was quick, thanks for your help. I'm going to try this now and report back...... Quote Link to comment Share on other sites More sharing options...
DSchragg Posted July 28, 2010 Author Share Posted July 28, 2010 Ok so I edited my .htaccess file, and this did not work...maybe host? This did work however: if($_SERVER['SERVER_NAME'] == 'french.mysite.com'){ header('Location: http://french.mysite.com/index_french.html'); } Thanks for your help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.