Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset htacces for sub-folders

Tags:

.htaccess

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 this?

Thanks!

like image 680
Martijn R Avatar asked Oct 11 '12 22:10

Martijn R


2 Answers

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.

like image 81
Pete - iCalculator Avatar answered Oct 13 '22 11:10

Pete - iCalculator


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.

like image 32
Kelvin Avatar answered Oct 13 '22 09:10

Kelvin