Best 404 to 301 Redirect Plugin

5 replies
I have a site that has thousands of 404's. I'm looking for a plugin that will turn all 404's into a 301 redirects. Can anyone recommend the best one for Wordpress?

Thanks
#301 #404 #plugin #redirect
  • Profile picture of the author Will Edwards
    Why don't you just create a good 404 page? You could put links to all you best stuff on there and a search form too. It would be helpful to your visitors and - dare I say it - that's what Google wants too.

    Will
    {{ DiscussionBoard.errors[8167927].message }}
  • Profile picture of the author dassad
    The easiest way to do this is the following:

    Open your Wordpress plugin folder and look for a file called "404.php" if not exists just create a new file with this name.

    Open the file for edit and add this for content (if the file was there just delete everything from it but a BACKUP is STRONGLY SUGGESTED)

    Add this into your 404.php file:

    PHP Code:
    <?php
    header
    ("HTTP/1.1 301 Moved Permanently");
    header("Location: ".get_bloginfo('url'));
    exit();
    ?>
    This will redirect every 404 page to your blog's homepage. If you want to redirect them to a custom URL than add this code and rewrite your URL:

    PHP Code:
    <?php
    header
    ("HTTP/1.1 301 Moved Permanently");
    header("Location: HTTP://CUSTOMURL.COM";
    exit();
    ?>
    Save the file and you are done.
    {{ DiscussionBoard.errors[8168369].message }}
    • Profile picture of the author plfbus
      Originally Posted by dassad View Post

      The easiest way to do this is the following:

      Open your Wordpress plugin folder and look for a file called "404.php" if not exists just create a new file with this name.

      Open the file for edit and add this for content (if the file was there just delete everything from it but a BACKUP is STRONGLY SUGGESTED)

      Add this into your 404.php file:

      PHP Code:
      <?php
      header
      ("HTTP/1.1 301 Moved Permanently");
      header("Location: ".get_bloginfo('url'));
      exit();
      ?>
      This will redirect every 404 page to your blog's homepage. If you want to redirect them to a custom URL than add this code and rewrite your URL:

      PHP Code:
      <?php
      header
      ("HTTP/1.1 301 Moved Permanently");
      header("Location: HTTP://CUSTOMURL.COM";
      exit();
      ?>
      Save the file and you are done.

      Thanks for this - handy info to stash away
      {{ DiscussionBoard.errors[8168503].message }}
  • Profile picture of the author Jwarri
    I think an easy way to deal with this is by using a wordpress plugin to redirect all of your 404 error pages to the correct page. It is quite simple to use, you just enter the url of the 404 page in one box and the url of the page you would like to redirect to in another box and you are done.
    Here is the url for the plugin; Redirection – Manage 301 redirections without modifying Apache | Urban Giraffe
    {{ DiscussionBoard.errors[8180557].message }}
  • Profile picture of the author ZerocooI
    Here is the url for the plugin; Redirection – Manage 301 redirections without modifying Apache | Urban Giraffe
    I have been using this for quite a while and it works great.
    Signature
    Zuziko.com Learn WordPress and Web Development
    {{ DiscussionBoard.errors[8180964].message }}

Trending Topics