jixodoj
jixodoj

Reputation: 329

How to disable parent htaccess rules in a specific folder

I have an htaccess in the main folder. I don't want to apply the main htaccess to a specific folder inside the main folder.

--Main Folder
  .htaccess
  some folder
  another folder --> don't want htaccess to apply here
  some files
  ...

How can I do this?

Upvotes: 5

Views: 942

Answers (1)

anubhava
anubhava

Reputation: 785128

Just create a one liner .htaccess in that specific folder where you don't want rules from main .htaccess to apply with:

RewriteEngine On

Note that this applies to mod_rewrite directives only. By default mod_rewrite rules defined in server context or parent context will be in effect on all the sub directories. By adding just RewriteEngine On in a subdirectory we turn on mod_rewrite engine but don't define any rules to effectively make that subdirectory and all children of that subdirectory to ignore rules defined in root/parent.

Upvotes: 2

Related Questions