Redirecting is not working after the update

This topic contains 8 replies, has 5 voices, and was last updated by  Stiofan O’Connor 8 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #55317

    Abhishek Modi
    Buyer
    Post count: 205

    Hi I have added the following code in functions.php of my theme as mentioned in tutorial to redirect the Custom Register pages But Unfortunately after the recent update it gives 404.

    Here is the code:

    
    
    add_action('init' , 'geodir_redirect_to_default_login') ;
    function geodir_redirect_to_default_login()
    {
    if(isset( $_REQUEST['geodir_signup']))
    {
      wp_redirect(home_url().'/register');
      exit();
    }
    }

    Don’t know what changes affecting the code ?

    Thanks

    #55318

    Abhishek Modi
    Buyer
    Post count: 205
    This reply has been marked as private.
    #55348

    Guust
    Moderator
    Post count: 29970

    Try re-saving your permalinks, or post your admin details.

    #55350

    Abhishek Modi
    Buyer
    Post count: 205
    This reply has been marked as private.
    #55400

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    we changed the login page from a “virtual page” to a normal page to avoid conflicts with few themes.

    Before it was:

    mysite.com/?geodir_signup=true

    Now it is

    mysite.com/gd-login

    As a conseuquence the function has changed:

    
    
    add_filter('geodir_login_url','change_geodir_login_url',10,3);
    function change_geodir_login_url($login_url,$args,$gd_page_id){
    //change the url to whatever you want.
    $login_url = 'http://your-site.com/my-login-page';
    return $login_url;}

    You should never delete GD Pages. You can recreate them using GD Tools.

    Thanks

    p.s. documentation has been edited.

    #55411

    Abhishek Modi
    Buyer
    Post count: 205

    Thanks a lot Paolo it worked perfectly, only thing } is missing in end.

    Have a Good Day 🙂

    #55413

    Paolo
    Site Admin
    Post count: 31206

    Ops, thanks for spotting that, I’ve corrected it.

    Thanks

    #63648

    jkirker
    Lifetime Member
    Post count: 298

    When using the above function to change the login URL we’re loosing the URL variables.

    For instance, with the “Business Owner?” or “Claim Listing” link is appended with: ?gd_go=claim but the extra values are lost.

    Any way to keep them? I’m trying to differentiate the Business Owner? link with the sign-in links at the top.

    Thanks,
    John
    `

    #63756

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    We have a function for that now, use this:

    geodir_login_url(array("gd_go"=>"claim"));

    Thanks,

    Stiofan

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount