Wednesday 5 October 2016

How to exclude a folder from WordPress permalinks?

The default WordPress rewrite rules for permalinks might not work in some cases. For example, when you have other settings defined in .htaccess files located in subfolders, or when you have other content in your website created in subfolders, or specific scripts or apps (not integrated with Wordpress) in subfolders.
To exclude ALL the subfolders from the WordPress rewrite rules, you need to edit the .htaccess file and change the bold line below:
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
to
RewriteRule ./ /index.php [L]
Basically, you are just adding a forward slash (/)
Your .htaccess file might look different, but with this guide you'll be on-track to apply the fix required in your own case.

No comments:

Post a Comment