Skip Navigation

[Resolved] Login Redirect

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 5 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#1384729

I've set a few pages to require login via the Access rules.
If a user tries to access one of these pages without being logged in, they are currently shown the 404 page.

How can we set custom login page?
That then redirects user to the page they were trying to access, after logging in?
/log-in/?redirect_to=/member-only-page/

#1384847

You can't set redirects with Access, but you can set Custom Contents Templates or Layouts as the "error" message instead of a 404.
This is described here:
https://toolset.com/documentation/user-guides/setting-access-control/#choosing-what-to-display-when-read-access-is-denied

If you need redirects you need Custom Code (It cannot be done with Toolset Access)
However if you want a redirect AFTER you login, you can just use the Toolset Login Management ShortCodes.
Something similar is elaborated in depth here:
https://toolset.com/documentation/user-guides/building-the-my-account-page/
This is the ShortCode you'd be using https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-login-form

Please let me know if you need more information about this.