• Resolved webcart

    (@webcart)


    Hi,
    I have a website with downloaded files that are protected.
    If someone wants to download a file he will be redirected to log in / register page.
    After the user registered / loged in he gets a welcome message but I need the file to be download and to redirect the user to the previous page the user came from.
    How could I do it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Abdul Wahab

    (@abdulwahab610)

    Hey, @webcart

    First of all, the Login Logout Menu plugin isn’t provide such functionality. You can use this plugin to add your Login/Logout links in your nav menu or use the shortcodes for them. Helping documentation.

    Let me help you with how you can overcome your issue. It depends on how you apply the protection to your downloadable files.
    1 – If you use any plugin, you have to contact their support forum. They can help you with that.
    2 – If you did custom work and used the login_redirect hook then the 2nd parameter will help you in redirect back to the same page. Your developer can help you in downloading the file after redirecting back.

    Thank you.

    Thread Starter webcart

    (@webcart)

    Hi,
    Thanks for your reply.
    The other plugin does not have a solution for it but I removed their redirect function after login and now the login acts normal and redirects to previous page as should be.
    Now my problem is with the Register page – can I add to your shortcode ?target=”_blank” ? It’s not the ideal solution but could help.

    Plugin Contributor Abdul Wahab

    (@abdulwahab610)

    Hey, @webcart

    target=”blank” isn’t an ideal solution. You can pass the redirect_to parameter in your registration URL the same as you did for the login URL.

    Thank you.

    Thread Starter webcart

    (@webcart)

    Hi @abdulwahab610,
    Thanks for your prompt reply.
    The login was redirected by wordpress automatically once I disabled the plugin login page.
    Should the registration page redirected automatically by wordpress like the login page?
    (The register page is made now by formidable).

    Plugin Contributor Abdul Wahab

    (@abdulwahab610)

    Hey, @webcart

    I don’t think that it works automatically. You can test it at your end. Otherwise, you can use the registration_redirect hook.

    Thank you.

    Thread Starter webcart

    (@webcart)

    Thanks @abdulwahab610,
    I will check it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Redirect to previous page’ is closed to new replies.