Reset htacces for sub-folders

前端 未结 4 434
野趣味
野趣味 2021-01-04 19:04

I have a htacces file in my root folder with some basic code in it. But I want that all those instructions get ignored in the directory \"voxelforum.com\". How can I achive

相关标签:
4条回答
  • 2021-01-04 19:37

    It depends on what rules you want to override:

    If you want to disable rewrite rules, then you can put a .htaccess file in the subfolder that contains RewriteEngine On, and the rules for the parent folder will be disabled (technically, replaced).

    Similarly, if you want to disable authentication for a subfolder, you can create a .htaccess that contains Satisfy Any.

    .htaccess rules cascade upwards, so Apache will look for a .htaccess file in the current folder and use the rules for it, then check the parent folder, etc.

    0 讨论(0)
  • 2021-01-04 19:38

    Put a .htaccess file in the subfolder and add this line only:

    RewriteEngine On

    0 讨论(0)
  • 2021-01-04 19:57

    Remove your htaccess from your root folder and move it in your subfolders. As far as I know there is no way to disable htaccess for the root folder.

    EDIT: check AllowOverride

    0 讨论(0)
  • 2021-01-04 19:58

    Oddly, you may first need to turn off rewrite and then put it on again

    Put a .htaccess file in the subfolder and add these 2 lines:

    RewriteEngine Off
    RewriteEngine On
    

    Add your rewrite rules below


    This worked for me whereas simply adding RewriteEngine On did not.

    0 讨论(0)
提交回复
热议问题