How to exclude a directory from WordPress permalinks in a Multisite environment?
The scenario is as follows:
A multisite install with three sites:
site1.com
(admin)site2.com
site3.com
Q: How to exclude a folder located in the root directory, which should also be associated with site3.com
?
That is: exclude a particular directory that does not belong to WordPress so that it is accessible from: site3.com/folderToExclude/
Back in the day site3.com
was a stand-alone site (now is part of the mentioned MU install), and this rule used to work:
RewriteCond %{REQUEST_URI} !^/(folderToExclude/.*)$
but that's no longer the case.
This is what the file looks like:
# BEGIN WordPress
IfModule mod_rewrite.c
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/(folderToExclude/.*)$
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) WordPress_04/$1 [L]
RewriteRule ^(.*\.php)$ WordPress_04/$1 [L]
RewriteRule . index.php [L]
/IfModule
# END WordPress