Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-11-2011, 10:28 PM   PM User | #1
MrCat
New Coder

 
Join Date: Jun 2006
Location: New Zealand
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
MrCat is an unknown quantity at this point
Question Auto redirect to 'index' file destroys HTTP_HOST

I have multiple domain names pointing to the same site.

This works fine in the root folder: mysite.com and myothersite.com begin at mysite.com/index.php and I can change display settings depending on HTTP_HOST (which is either set to mysite.com or myothersite.com).

It doesn't work when I go one folder deeper: mysite.com/start and myothersite.com/start are always seen as mysite.com/start/index.php - destroying the HTTP_HOST variable.

What can I do? I'm on a shared host so can't do much in the way of config.
Any help appreciated
MrCat is offline   Reply With Quote
Old 12-12-2011, 07:36 PM   PM User | #2
Cags
New Coder

 
Join Date: Jul 2011
Posts: 67
Thanks: 0
Thanked 13 Times in 13 Posts
Cags is an unknown quantity at this point
You'll need to make all the links on your site full paths, built up using the HTTP_HOST field. If you do this then the links on pages should always remain the same as the domain they originally arrived on.
Cags is offline   Reply With Quote
Old 12-13-2011, 08:11 AM   PM User | #3
MrCat
New Coder

 
Join Date: Jun 2006
Location: New Zealand
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
MrCat is an unknown quantity at this point
Thanks Cags, but the HTTP_HOST field is the problem as it doesn't contain the domain I originally arrived on.
Once Apache redirects from a folder URL to the index file URL, the HTTP_HOST reverts to the 'parent' domain and not the alias I arrived on.
I hope I'm making sense!
MrCat is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:19 AM.


Advertisement
Log in to turn off these ads.