1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable Wordpress Auto Redirect?

Discussion in 'Black Hat SEO' started by Russian425, Oct 23, 2013.

  1. Russian425

    Russian425 Regular Member

    Joined:
    Jun 7, 2011
    Messages:
    315
    Likes Received:
    150
    Does anyone know how to disable wordpress auto-redirect?
    For example, I have a page mysite.com/my-first-page/
    I decided to delete that page and create a new page mysite.com/my-first-page-today/
    Now, wordpress decided to redirect mysite.com/my-first-page/ to mysite.com/my-first-page-today/ . In some cases it's great, however I don't want to do that.
    How can I disable it?
     
  2. shanna_doll

    shanna_doll Power Member

    Joined:
    Apr 10, 2012
    Messages:
    655
    Likes Received:
    324
    Location:
    Bosnia and Herzegovina
    htaccess i guess..
     
  3. alternatesword

    alternatesword Jr. VIP Jr. VIP

    Joined:
    Aug 25, 2012
    Messages:
    2,972
    Likes Received:
    548
    Location:
    scabbard
    Home Page:
  4. Russian425

    Russian425 Regular Member

    Joined:
    Jun 7, 2011
    Messages:
    315
    Likes Received:
    150
    Tried it, didn't work.
     
  5. Russian425

    Russian425 Regular Member

    Joined:
    Jun 7, 2011
    Messages:
    315
    Likes Received:
    150
    Figure it out. It's stupid wordpress auto-redirect when it's trying to "guess" the correct url.

    To fix it you have to add the following code to functions.php in your theme

    remove_filter('template_redirect', 'redirect_canonical');