I need to hide the site from guest users and show it just if preview variable is presented or the user is in wp-admin folder.
Now in .htaccess I have
RewriteEngine On
RewriteBase /
RewriteRule (.*)/wp-admin(.*) - [QSA,L,NC]
RewriteCond %{REQUEST_URI} !/wp-admin [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteRule . / [L]
It works well for the task condition. I need to check if there is a preview GET parameter is presented and allow such request to be handled by index.php. The request can look like
http://domain.com/about/?preview_id=152&preview_nonce=657d480c2c&preview=true
Of course if preview variable exists all assets should be handled in a normal way.
How can it be done?
You can add one more
RewriteCond
forpreview
parameter: