Introduction
Many content management systems, such as WordPress, provide a default .htaccess file that contains SEO-friendly rewrite rules. These can often cause issues with subfolders that have their own application. This article provides the procedure to exclude a folder from rewrite rules.
Procedure
- Open the .htaccess in the folder's parent directory in your preferred text editor.
- Insert a new line before the first
RewriteCond
line. - Add the following to the new line.
RewriteCond %{REQUEST_URI} !^/folder/.*$
Please note that "folder" must be replaced with the folder name to exclude. - Save the changes and exit the text editor.
The following is an example of a rewrite rule excluding a folder.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/folder/.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Comments
0 comments
Article is closed for comments.