Is it possible to have multiple .htaccess on shared hosting?

Discussion in 'Web Hosting' started by shellyreynolds, Jan 23, 2010.

  1. #1
    Here's the dilemma...

    I'm setting up a website that needs its own .htaccess in order for the application on it to work. If I have a shared hosting account, won't this mess up the other hosted sites?

    For example:

    Let's say my hosting account is set up under http://mainsite.com

    Then http://secondarysite.com needs its own .htaccess. This site is aliased to mainsite.com.

    How does this work? Will the .htaccess in the root of secondarysite.com affect mainsite.com or any of the others?

    Thanks
     
    shellyreynolds, Jan 23, 2010 IP
  2. aquilax

    aquilax Member

    Messages:
    126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #2
    .htaccess is applied only to child directories and files
     
    aquilax, Jan 23, 2010 IP
  3. shellyreynolds

    shellyreynolds Peon

    Messages:
    202
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sorry but I don't know what child directories exactly means (being a webmaster isn't my strongpoint LOL). I'm guessing that means it's only applied to files in its folder and inner files?

    i.e. if the htaccess was placed in folder 2...

    site.com/folder1/folder2/example

    ...then it would not affect anything in folder 1... is that correct?

    Thanks again
     
    shellyreynolds, Jan 23, 2010 IP
  4. aquilax

    aquilax Member

    Messages:
    126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #4
    Yes exactly. For

    /home/user/dir1/dir2/dir3/dir4
    /home/user/dir1/dir5/

    a .htaccess placed in dir2 will affect only files and directories which are placed in dir2 (dir3,dir4). dir1 and dir5 will remain unaffected
     
    aquilax, Jan 23, 2010 IP
  5. shellyreynolds

    shellyreynolds Peon

    Messages:
    202
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you for confirming that aquilax, very much appreciated!
     
    shellyreynolds, Jan 23, 2010 IP