Skip to main content

Restricting htaccess heirarchy

Comments

5 comments

  • cPanelMichael
    Hello :) This thread should be helpful: Disable .htaccess Thank you.
    0
  • outpostmm
    Thanks for the reply. It doesn't look like the AllowOverride directive is going to work for this situation. It looks like I can only apply that directive in the main server config file, and I can't use regular expressions to specify the directories. So that wouldn't work if I want to set a rule to disallow .htaccess files in all subdirectories under /home/[user]/public_html/resources while allowing the .htaccess file in resources to keep working. For us that directory pattern would have to be public_html/resources/[0-9]*/.
    0
  • quietFinn
    [quote="outpostmm, post: 1495771">Thanks for the reply. It doesn't look like the AllowOverride directive is going to work for this situation. It looks like I can only apply that directive in the main server config file, and I can't use regular expressions to specify the directories. So that wouldn't work if I want to set a rule to disallow .htaccess files in all subdirectories under /home/[user]/public_html/resources while allowing the .htaccess file in resources to keep working. For us that directory pattern would have to be public_html/resources/[0-9]*/.
    If you read here: [url=http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride]core - Apache HTTP Server It says: [QUOTE] AllowOverride is valid only in sections specified without regular expressions, not in , or sections.
    You should be able to get it to work if you set AllowOverride in each virtualhost separately.
    0
  • outpostmm
    If I can't use a regular expression in the directory specification, how can I set that option for all sub-directories under resources while still allowing it in resources?
    0
  • quietFinn
    [quote="outpostmm, post: 1495792">If I can't use a regular expression in the directory specification, how can I set that option for all sub-directories under resources while still allowing it in resources?
    Right, guess it's not possible then... What if you disable .htaccess completely and then do that redirection in virtualhost(s)?
    0

Please sign in to leave a comment.