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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    824
    Thanks
    93
    Thanked 18 Times in 18 Posts

    Point a domain to a certain folder

    I'm not sure if this is apache or not so if not please tell me where I should post this .

    Using the windos hosts file I've made it so if I go to www.forum.com it shows my root localhost folder, however I'd like it to show a certain sub folder.

    Is there a way with I can make apache look what the domain is, and if its forum.com use the sub folder as the default folder it uses?

    EDIT:

    I've just found and tried adding
    Code:
    <VirtualHost *>
    ServerName www.forum.com
    DocumentRoot "C:/Websites/Dropbox/NAPF"
    </VirtualHost>
    And that seems to work .
    Last edited by tomharto; 09-06-2012 at 08:48 AM.

  • #2
    Regular Coder stevenmw's Avatar
    Join Date
    Jun 2007
    Location
    OK
    Posts
    497
    Thanks
    27
    Thanked 31 Times in 31 Posts
    If you wanted you could always change the directory index. So whenever you go to www.forum.com it will go to the files you specify.

    Code:
    DirectoryIndex subfolder/this.html index.html
    If subfolder/this.html doesn't exist it will go to index.html in the root folder instead.


  •  

    Posting Permissions

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