You could force any URL that contains a preview_id
URL parameter to the WordPress front-controller (ie. index.php
). This will effectively bypass the WP code block for these type of URLs. (It is the WP code block that skips these requests when they map to your static directories.)
(This avoids having to modify the existing "WordPress" rules, as I mentioned in comments.)
Add the following before the WordPress code block, ie. before the # BEGIN WordPress
comment marker.
# Send any URL with "?preview_id=" immediately to the WP front-controller
RewriteCond %{QUERY_STRING} ^preview_id=
RewriteRule ^ index.php [L]
# BEGIN WordPress
: Remaining directives follow...
UPDATE:
The wordpress theme I'm using has a live builder feature where you can visually see your changes as you make them.
Add a series of OR
'd conditions for each request that needs to be routed through WordPress. For example:
# Force some URLs to the WP front-controller
RewriteCond %{QUERY_STRING} ^preview_id= [OR]
RewriteCond %{QUERY_STRING} ^fb-edit= [OR]
RewriteCond %{QUERY_STRING} ^builder=
RewriteRule ^ index.php [L]
NB: Never use the OR
flag on the last condition since that will unconditionally send every request to index.php
. (It would basically be interpreted as OR true
.)
Alternatively, that can be written with one condition using regex alternation if there are only a few exceptions like this. For example:
# Force some URLs to the WP front-controller
RewriteCond %{QUERY_STRING} ^(preview_id|fb-edit|builder)=
RewriteRule ^ index.php [L]