Login Redirect

Discussion in 'aMember Pro v.4' started by umitbatu, Apr 26, 2012.

  1. umitbatu

    umitbatu aMember Pro Customer

    Joined:
    Dec 16, 2011
    Messages:
    16
    On my site there is a "Login" link on every page. The user reaches the login page either by clicking on one of the protected page links or clicking the "Login" link. If the user clicks the protected page link and then logs in succesfully he is taken to that protected page he attempted to view. No problem with that.

    My question is when the user clicks the "Login" link from an unprotected page and then logs in successfully how can I redirect him to the page where he came from? Currently he is taken to the "My Account" page.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Add this parameter to login link url:
    ?amember_redirect_url=/url/of/the/page/where/user/will/be/redirected/after/login
  3. rcordpa

    rcordpa New Member

    Joined:
    Dec 29, 2009
    Messages:
    8
    Hi, Different question but similar subject.

    Im using amember 4.1.15

    In amember v3, I had several membership subscription levels with a different landing page after login for each subscriber. Subscription A landed on a blog A, Subscription B landed on Blog B, Subscription C landed on a video library. A subscriber could also have more than one subscription but multiple subscriptions would bring them to the member profile page.

    I figured out the protection scheme of version 4 but for the life of me can't figure out how to work the redirects. I liked the old way where you had a box to enter the redirect url. I tried using the SETUP>LOGIN and tried choosing the first, last fixed drop down but that didn't work.

    I suppose I could work around it by directing everyone to the my_site/amember/member page and then they can link to their subscription from there but there should be a nicer and easier way? Yes?
  4. tlever

    tlever New Member

    Joined:
    Apr 23, 2012
    Messages:
    10
    No response to the last question above?? ^^
    I also have this problem and can't figure it out. There should be a simple way to redirect after login based on the product/membership level of the user. How is this done? Any help would be greatly appreciated.
  5. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
  6. tlever

    tlever New Member

    Joined:
    Apr 23, 2012
    Messages:
    10
    For those who want and need to know, this is what I've learned:

    In my situation, I have a free level membership and a premium paid membership. I need the customer to be redirected after login to two different locations depending on their membership level. Here is how I was able to finally make it work.

    1) On my server, I created a folder inside the amember directory called "loginFree" and another one called "loginPremium".

    2) Inside those folders I placed the pages that I needed the user redirected to. If you don't want to move your files into those locations, place simple redirecting pages (like simple php redirects) into those locations. But here is what I found to be the REAL key to all of this. Make certain that inside those directories, the first file you want them to be redirected to is named "index.html".

    The reason for this is that the only way this seems to work is by using Protected FOLDERS. Trying to use protected links doesn't seem to work, contrary to other posts in these forums indicating that is the way to do it. By making the file you want them redirected to the index.html of that directory, when they are redirected to that folder (see below) it will automatically pull up the index.html file. (For those that don't know, this is standard internet protocol. If a browser is directed to a folder/directory as opposed to a specific file name, it will automatically select any file named index.html within that directory/folder and pull that up in the browser.)

    3) I went into my amember Admin interface and selected the Protect Folders area. In there, I chose to protect each of those two directories I created. When protecting the loginFree directory, be sure to then associate that with the Free Membership product. Alternately, protect the loginPremium folder and then associate that protection with the Premium Membership product.

    4) Finally, go into the Config/Login area and select to redirect after login to 1st protected URL.

    The reality here is that the Config/Login Redirect option for redirecting after login should really have the option named "First available Protected FOLDER" as opposed to "First available Protected URL". It would make the situation much more self-explanatory to people trying to figure this all out. The only way I've been able to get it to work is using this protected folder and index.html method described above. Creating protected links and then redirecting doesn't work. That method just sends the customer to the Membership page and shows them those links associated with their membership level - it doesn't automatically redirect them to any of the links.

    I hope this helps out some other people like me who've been asking for a while for this solution. :)

    Best,
    Tim

Share This Page