The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess propagates to add-on domains

Discussion in 'General Discussion' started by shacker23, Apr 6, 2006.

  1. shacker23

    shacker23 Well-Known Member

    Feb 20, 2005
    Likes Received:
    Trophy Points:
    Hmmm... a user has a main domain protected with .htaccess -- working fine.

    Then they add an add-on domain, which of course is installed under public_html. The password protection propagates to the add-on domain, which they don't want password protected.

    Apache is working properly - .htaccess is working as it should, as far as apache is concerned. IMO, this is a problem with the way cPanel sets up add-on domains (Plesk handles this better - add-on domains go into their document root rather than sharing one with the main domain).

    Meanwhile, is there a way to turn off password protection for the add-on domain?

    I asked a similar question regarding mod_rewrite a while ago for another client:

    The answer there was to turn off mod_rewrite for that subdir. But I can't figure out how to turn off password protection for subdirs. Ideas? The only other alternative I can think of would be to move the main domain to public_html/maindomain and the add-on to public_html/addondomain. This would require editing httpd.conf and reconfiguring their MovableType installation. Doable, but would prefer to avoid if possible.

  2. chirpy

    chirpy Well-Known Member

    Jun 15, 2002
    Likes Received:
    Trophy Points:
    Go on, have a guess
    AFAIK, that's going to be the only option - moving the DocumentRoot in httpd.conf for the addon domain to a higher level.
  3. Spiral

    Spiral BANNED

    Jun 24, 2005
    Likes Received:
    Trophy Points:
    There is an easier way ....

    Create a .htaccess file in the add-on domain folder

    (If it has it's own .htaccess, it will superceed the main site .htaccess)

    Another cleaner but somewhat more complicated solution would be
    to move the add-on folder to the main root folder of the account
    on the same tier as public_html and then update the httpd.conf
    to point the add-on domain to that location.

    Doing it this way, the add-on domain functions totally separate and
    is no longer effected by any settings of the main domain.

    If you use this option, don't forget to restart Apache after updating
    the /etc/httpd/conf/httpd.conf file.
    #3 Spiral, Apr 9, 2006
    Last edited: Apr 9, 2006

Share This Page