Jump to content

Redirect to Custom Maintenance Site


Orkun
 Share

Recommended Posts

Hi Guys

How can I make a redirect inside the .htaccess to my custom maintenance.html file when any URL of my Website is accessed except the processwire admin (www.example.com/processwire/).

Because I want that my User's still can access the website when they are loggedin in Processwire.

When the current url starts with /processwire or if there is a processwire-login-cookie (Is there a cookie when user is logged in Processwire?) available the redirect should not work. Otherwise it should work.

How can I achieve this?

Link to comment
Share on other sites

You can not determine in .htaccess if a user is logged in. If you want to redirect "anonymous" users to somewhere else, then I'd place that into _init.php. Something like:

if(!$user->isLoggedin())
	$session->redirect('PlaceUrlHere');

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...