• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Redirect 404 Page Not Found To Any URL

redirect 404 page

If fixing broken links is something you tend to avoid, here’s a simple solution which you might like as a quick fix until you can fix your broken links properly.

Please copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++

This code will redirect ALL 404 page errors to the example.com url which you can change to anything you like.

More 404 Page Solutions

  • 5 Ways To Customize Your 404 Page

Reader Interactions

Comments

  1. Ephrem says

    March 21, 2014 at 1:18 pm

    Hello Brad Dalton, Thanks i its nice thing and helpful for SEO .
    But can i use it for phpmelody Video script page which is built by phpsmaarty template?

    Log in to Reply
    • Brad Dalton says

      March 21, 2014 at 1:20 pm

      It redirects any URL which returns 404 so i don’t think it matters where the template comes from.

      Log in to Reply
      • Ephrem says

        March 21, 2014 at 10:55 pm

        i tried it in the PhpMelody function.php file but It did not work for me. Just to let you know!

        Log in to Reply
        • Brad Dalton says

          March 21, 2014 at 10:56 pm

          It works perfectly in any theme.

          I know this because i tested it.

          The code goes in your child themes functions file and will not work in other files.

          Whats PhpMelody?

          Log in to Reply
  2. gaston says

    March 21, 2014 at 4:12 am

    But it affects SEO? or confuse our visitor. Better (for me) is redirect to a page for error 404 with a search box and related articles.
    (sorry for my bad english)

    Log in to Reply
    • Brad Dalton says

      March 21, 2014 at 12:30 pm

      I think its better to not have 404 errors and maybe direct to a page with a list of posts, categories and search box that works.

      Log in to Reply
  3. Dave Fogel says

    March 18, 2014 at 3:33 pm

    Wow, that is pretty slick. I think I will use that.

    Log in to Reply
    • Brad Dalton says

      March 18, 2014 at 3:39 pm

      Easier than using your .htaccess file i think Dave.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.