Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    New Coder
    Join Date
    Jul 2011
    Posts
    67
    Thanks
    0
    Thanked 13 Times in 13 Posts
    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.

  • #3
    New Coder
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •