Looking for Automatic 301 Plugin for WordPress

7 replies
  • SEO
  • |
Has anyone seen or used an automatic 301 Plugin (redirect) for WordPress?

I've found several plugins, but they require you to define the missing page and set up a redirect.

What I want is this - if someone goes to a non-existing page, instead of getting a 404 error (and a 404 in the header sent back to the browser) I instead want it to send a 301 to a specific page (if that 404 page was configured and mapped) OR send to the home page with a 301 if that specific page was not mapped.

The idea is that there will never be a 404 error on the site and if there is a missing page we treat it as a 301 to the home page.

Has anyone seen this?

Thanks!
#301 #automatic #plugin #wordpress
  • Profile picture of the author DeskCoder
    Put the redirect at the top of your 404.php file in your theme.

    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?>
    {{ DiscussionBoard.errors[5168022].message }}
    • Profile picture of the author Talen
      There is a wordpress plugin called link juice keeper that does exactly what you want.
      {{ DiscussionBoard.errors[5168440].message }}
    • Profile picture of the author M_Usman
      Originally Posted by DeskCoder View Post

      Put the redirect at the top of your 404.php file in your theme.

      <?
      Header( "HTTP/1.1 301 Moved Permanently" );
      Header( "Location: http://www.new-url.com" );
      ?>
      Dose this code works automatically for all 404 or I need to set each URL settings?
      {{ DiscussionBoard.errors[7831835].message }}
      • Profile picture of the author paulgl
        I never send people to the index page. There's no
        explanation, and it's a bad user experience.

        Make a custom 404 error page for a what is called
        a soft landing.


        Normally urls that are no longer there via some
        nonsense from WP, will never show up in google
        searches by real people doing real searches.

        A 301 should be used as it was intended, not
        for a bunch of urls that don't really exist, and
        get created ad nauseum.

        Everybody should have a custom 404 error page.

        I'm not sure , but I think the 404 error is
        still logged no matter even if you use some code.

        Besides, you still want the visitor to know what happened.

        Paul
        Signature

        If you were disappointed in your results today, lower your standards tomorrow.

        {{ DiscussionBoard.errors[7831891].message }}
  • Profile picture of the author yukon
    Banned
    I do what DeskCoder does above with some of my sites 404.php pages.

    Here is the Wordpress 404/301 redirect code I use.


    This will redirect 100% of all broken links back to the Wordpress blogs Index page.

    The code above is the only code inside my 404.php file.

    [edit]
    The forum keeps breaking my php code, that's the reason for the code/screenshot.
    {{ DiscussionBoard.errors[5169109].message }}
  • Profile picture of the author DeskCoder
    I didn't think about the status code ... but I just checked in Firebug (NET panel), and there is no 404, just a 301 if you add the php redirect to the top of the 404.php page.
    {{ DiscussionBoard.errors[5170442].message }}

Trending Topics