Jump to content

2 Domains, 1 Site, load different index files


DSchragg

Recommended Posts

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.

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]

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......

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.