htaccess shenanigans!
Author
Discussion

anonymous-user

Original Poster:

84 months

Monday 16th August 2021
quotequote all
I was looking for an easy way to make a site maintenance page, so if a switch is set in a DB all requests get sent to a holding page, I found this code :-

https://rimuhosting.com/knowledgebase/creating-a-m...

Which I've got working to a degree! My issue is the user will not have a fixed IP address so once the flag is set they see the site maintenance page as well.

What I need to do is redirect all "user traffic" to the maintenance page but allow requests to pages that are in a set directory/directories (eg, /backend/admin/) to work as normal.

Possible?!

TIA smile

anonymous-user

Original Poster:

84 months

Monday 16th August 2021
quotequote all
Sorted, I think!

RewriteCond %{REQUEST_URI} !^/backend/