Redirect question


I'd like to redirect the user when they login to their own site.

I downloaded the Login Redirect plugin here but unfortunately I must use a static URL.

Any ideas? I would greatly appreciate it!


  • Arun Basil Lal
    • New Recruit

    Hello Giovanni,

    One solution I can think of is editing the plugin directly. The plugin is a fairly simple one, I think editing the part where the plugin actually fetches data from the form would be good enough. Just replace, the following with a function that can return the url with the username:

    get_site_option( 'login_redirect_url' )

    I will ask the developer to take a look at this. Lets see what comes up!

    Arun Basil Lal

  • Timothy
    • Chief Pigeon

    Hey there! :slight_smile:

    Just checking in to see how things are going with this one and if you need any further help. :slight_smile:

    For getting the username you can use the WordPress function get_currentuserinfo:

    Anyway, as we haven't heard from you on this thread for a while, perhaps you got help over email. I'm going to presume your all fixed up now and don't need any further assistance.

    However if you have more questions or need some more help then please feel free to respond in this thread or create a new one and we will be more than happy to offer assistance. :slight_smile:

    Take care.

  • Baeta
    • WPMU DEV Initiate

    Hi Giovanni!

    Here was the solution I made.

    In the plugins/login-redirect folder there is a file login-redirect.php

    Edit the file on line 62 -> function redirect
    Insert this line above:
    global $user_login;

    Where you have: (Appear 2 times)
    $login_redirect_url = get_site_option( 'login_redirect_url' );

    Change for this: (Appear 2 times)
    $login_redirect_url = '/'.$user_login.'/' ;

    Save and upload.

    Best regards,

  • Giovanni
    • The Incredible Code Injector


    Thanks for the msg. Yea, trip is going well and had to put some stuff aside. Need to get into things soon though! I did upload a new video on my blog and a series of posts that talk about how to travel the world for less than $50/day. =)

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.