Posts Tagged sub folder htaccess

How to reset the htaccess rules for sub folders

Normally htaccess rules applied to all folder and subfolder also, if we need to restrict one of the sub folder then we need to use the redirect condition like below

# subfolder
RewriteCond %{HTTP_HOST} ^example.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/website/
RewriteCond %{REQUEST_URI} !^/somefolder/
RewriteCond %{REQUEST_URI} !^/client/blabla/
RewriteRule (.*) /website/$1

that above code will apply redirect rules except the three folders “website”, “somefolder”, “client/blabla/”. but that one is hard to include all rules using the rewrite condition some times above code may help to exclude the directory.

At last i found one simple solution to avoid the sub folders using this code, we just need to create the “.htaccess” files and put the below code

RewriteOptions inherit

that above code will reset all rules from parent htaccess files so now we can easily install drupal / joomla inside the wordpress site else vice versa.

 

Posted in: Uncategorized, Web Developers/Designers Reference Guide

Leave a Comment (0) →