Changing Index Location

Discussion in 'Apache' started by JosS, Aug 16, 2007.

  1. #1
    Not sure if this can be done, but thought i'd ask.

    I have a primary domain with hostgator.com primary.com

    Now, I also have about 30 add-on domains so in my root directory,

    It looks like

    domain1/
    ..
    ..
    domain30/

    Then on top of that, in the root directory is meant to be everything for primary.com

    Is there any way I can move primary.com's files to a folder called primary for example, then put a htaccess to tell it to pull the contents from the primary directory.

    However, I still want it to look like primary.com/index.html not primary.com/primary/index.html

    Cheers :D
     
    JosS, Aug 16, 2007 IP
  2. bilal@revolutionhosting

    bilal@revolutionhosting Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You might want to try this:

    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?primary.com
    RewriteCond %{REQUEST_URI} !/primary/
    RewriteRule ^(.*)$ /primary/$1 [L]
    
    Code (markup):
    This would map all requests to files on primary.com (with or without www) to the "primary" directory.
     
    bilal@revolutionhosting, Aug 17, 2007 IP