The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Making a domain go to a certain subdirectory?

LuxLux Registered User regular
edited December 2008 in Help / Advice Forum
How do I do this? Normally I only use one domain for one piece of web space. But in this case, I have two domains. One goes to the main index.htm, but I want the other to go to an index.htm in a subdirectory.

I'm confused because the only way I know how to attach domains to a site is to input the nameservers & stuff, and it automatically finds the main index.html page.

Please help a layman out.

Thanks.

Lux on

Posts

  • ProPatriaMoriProPatriaMori Registered User regular
    edited December 2008
    That's usually configured on the server itself. I know Apache has specific configuration options to send requests for a certain domain to a specific place.

    ProPatriaMori on
  • YourFatAuntSusanYourFatAuntSusan Registered User regular
    edited December 2008
    You can use a simple PHP redirect.

    Create index.php and put it in the root folder of your domain and enter the below text in that file.
    <?php
    header( 'Location: http://www.domain.com/subdirectory/' ) ;
    ?>

    YourFatAuntSusan on
    [SIGPIC][/SIGPIC]
  • MKRMKR Registered User regular
    edited December 2008
    Well you see, when a daemon loves a client...

    Since you don't know how, I'm going to assume you're on shared hosting. The best thing to do is check with your web host. They may charge for adding a second domain to your space, and they probably have their own process for adding it.

    MKR on
  • wasted pixelswasted pixels Registered User regular
    edited December 2008
    MKR wrote: »
    Well you see, when a daemon loves a client...

    Since you don't know how, I'm going to assume you're on shared hosting. The best thing to do is check with your web host. They may charge for adding a second domain to your space, and they probably have their own process for adding it.

    This. In your host's control panel, there will be an option to add an "addon domain" (again, you may have to pay a bit extra -- telling us who your host is would help), and it'll do exactly what you describe; you'll point the domain to your host's nameservers, they'll create a folder in your main account called /whatever.com, and you're good to go.

    wasted pixels on
Sign In or Register to comment.