Introduction
Many content management systems, such as WordPress, provide a default .htaccess file that contain SEO friendly rewrite rules. These can often cause issues with subfolders that have their own application. Excluding certain subfolders can be achieved using the steps below.
Procedure
The following line can be added in the parent directory's .htaccess file to exclude particular subfolders:
RewriteCond %{REQUEST_URI} !^/(subfolder1|subfolder2/.*)$
Just replace 'subfolder1' and 'subfolder2' with the directories needing to be excluded. For example, the below is how it would look with a default WordPress .htaccess file:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(subfolder1|subfolder2/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Comments
0 comments
Article is closed for comments.