Tips and Tricks HQ Support Portal › Forums › WP eMember › eMember – after login redirect to previous page
Tagged: redirect
- This topic has 7 replies, 4 voices, and was last updated 7 years, 4 months ago by admin.
-
AuthorPosts
-
April 8, 2015 at 4:13 pm #12470DorinMember
Hi, Is there a possibility to redirect the user after the login to the previous page?
For example, the user access a protected page and the message to login appear. The user then hit the login button, successful login and then the redirect page should be the protected page from where he hit the login button.
Is this possible?
Thank you.
April 8, 2015 at 4:28 pm #69509wzpModeratorHave you tried using the popup login? When you use that option, the user can log in while staying on that page:
https://support.tipsandtricks-hq.com/forums/topic/emember-use-popup-login-and-redirect-to-page
June 28, 2017 at 1:53 am #69510karencheahMemberHi, I’m wondering if this redirect is possible if we don’t use the popup login. We have a situation where we are using a plugin for a directory and to submit a listing to the directory, will require login. So the configuration in the directory plugin need the actual login page URL to get member to login first. However, after login, it doesn’t redirect back to the directory page even though it is set in the URL to redirect. I have already removed the redirect page in eMember settings which I thought was overriding the URL redirect to the directory page.
Is this something that can be done? Thanks.
June 28, 2017 at 2:09 am #69511adminKeymasterThe following documentation explains all the redirect options available in the plugin:
There is an “inline login” option which lets you stay on the page after the login (even though you have configured after login redirection). Check that option to see if that works for you.
There is also a way to override the after login redirect by adding a query parameter to the URL. Useful if you are linking to a protected page and want the user to stay on that page after the login. The following post has explanation on how to do that:
https://support.tipsandtricks-hq.com/forums/topic/is-there-a-way-to-override-redirect-after-login
June 28, 2017 at 2:24 am #69512karencheahMemberThanks for your suggestion. Unfortunately I’m not sure how I can use the inline login as the directory plugin asks for a URL to the login page. And when public click on the button in the directory, it will go to the login page. It is not quite a protected page. More like the directory detects that there’s no login, so will go to the login page that has been specified in the configuration. So it can’t be the inline login.
I also can’t protect the directory listing page as it should be visible to public. If I could, that would probably work to bring up the inline login.
I’ve had a look at the links above too. The first won’t work as it is not a static redirection. That worked ok to always redirect to the same page after login but not this situation. The second link with the URL is similar to what is required. The directory button actually put a redirect_to parameter after the login. But that redirect_to parameter doesn’t seem to take effect. That is the problem. Here’s the URL (with edited domain name).
[http://somedomainname.com/member-login/?redirect_to=http%3A%2F%2Fsomedomainname.com%2Fbusiness-directory%2F%3Fwpbdp_view%3Dsubmit_listing]
Should that work or not?
June 29, 2017 at 1:22 am #69513adminKeymasterWe can add an option so our plugin redirects to the URL specified in the “redirect_to” query parameter after the login operation. Will that help?
June 29, 2017 at 1:26 am #69514karencheahMemberIf it’s not too difficult and will not affect how the other redirection in eMember works, that would be great! Otherwise, we can live with a workaround of getting members to login first before they are able to click on the submit listing. Thanks.
June 30, 2017 at 1:46 am #69515adminKeymasterI had a look at the code and I think I should be able to add an option without upsetting any of the existing redirection. Give me a reminder if I forget about it.
-
AuthorPosts
- You must be logged in to reply to this topic.