Jump to content

Redirect to Homepage after login


remove
 Share

Recommended Posts

I hope someone can help.

In development fase, I would like to hide the homepage (also for google) with login fields. When a user(client) logs in they redirect to the homepage.

What is the approach in WP. Is it build in admin or do I need a script? Where do I start?

Link to comment
Share on other sites

Another alternative: https://github.com/adrianbj/ProtectedMode

I haven't added it to the modules directory just yet.

Official forum post: https://processwire.com/talk/topic/7723-protecteddevelopment-mode/

Modules directory: http://modules.processwire.com/modules/protected-mode/

The reason I built this, rather than using the Maintenance Mode module was:

  • I didn't want the "Maintenance Mode" badge showing up on the site since it really is for development before a site has ever been live.
  • I didn't want users redirected to the PW login page because I did want visitors to see the login page. I know the module has the option to redirect to a custom page, which you could use to make a front-end login form, but that seemed more complex than I needed (and I think other PW devs might also need).
  • Because of the way this module replaces Page::render with the login form, visitors can be sent to any page on the site, and once they login that page will reload with its full content - no messing around finding the page again, and no need for sending page ids through the login process to redirect back.
  • This module also lets you configure the message that is displayed along with the login form.

I don't see this as a replacement for Maintenance mode at all. It has less options and is not really appropriate for scheduled maintenance time - it doesn't send a 503 - although Maintenance Mode doesn't do that either.

 

If you try it, let me know how it works out for you.

  • Like 4
Link to comment
Share on other sites

Another alternative: https://github.com/adrianbj/ProtectedMode

I haven't added it to the modules directory just yet.

The reason I built this, rather than using the Maintenance Mode module was:

  • I didn't want the "Maintenance Mode" badge showing up on the site since it really is for development before a site has ever been live.
  • I didn't want users redirected to the PW login page because I did want visitors to see the login page. I know that Pete's module has the option to redirect to a custom page, which you could use to make a front-end login form, but that seemed more complex than I needed (and I think other PW devs might also need).
  • Because of the way this module replaces Page::render with the login form, visitors can be sent to any page on the site, and once they login that page will reload with its full content - no messing around finding the page again, and no need for sending page ids through the login process to redirect back.
  • This module also lets you configure the message that is displayed along with the login form.

I don't see this as a replacement for Maintenance mode at all. It has less options and is not really appropriate for scheduled maintenance time - it doesn't send a 503 - although Maintenance Mode doesn't do that either.

 

If you try it, let me know how it works out for you.

FANTASTIC!

I have tested your module. It works perfectly and like it a lot, simple and effective. 

Thank you for sharing!

  • Like 3
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...