Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Global .htaccess

Discussion in 'Security' started by PCZero, Mar 10, 2013.

  1. PCZero

    PCZero Well-Known Member

    Dec 13, 2003
    Likes Received:
    Trophy Points:
    I have an htaccess file set up in /home to be set things at a global level for all accounts. Everything is working just fine with one exception...

    In the global file I have Rewrite enabled and several Rewrite rules. These are all function just fine for all accounts EXCEPT if a given account has additional Rewrite rules in its htaccess within its web root. In this case the global rewrite rules seem to be ignored and only the local ones are followed. As long as the user's htaccess has no rewrite rules, the combined effect of the global and user specific htaccess files seems to be in place and working fine.


    1) Is this the normal behavior for htaccess?
    2) How do I set things up so that the user specific htacces will always be additive to the user htaccess?
    3) I want the user htacess to have precedence over the global in case they both set a given value (such as ErrorDocument). IOW, if both set a ErrorDocument, I want the vale specified in the user specific htaccess to be the one used. Is this the standard and if not how do I set it so that this is how it will work?
  2. nithintou

    nithintou Member

    Dec 22, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    This is normal behaviour. You need the following in your per domain .htaccess or Virtualhost:
    RewriteOptions Inherit

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice