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

Wordpress 404 problem

Discussion in 'Blogging' started by Codythebest, Jan 13, 2012.

  1. Codythebest

    Codythebest Senior Member

    Joined:
    May 29, 2009
    Messages:
    1,138
    Likes Received:
    884
    Location:
    Fuerteventura
    Home Page:
    I have a blog indexed in G.
    But all the page named : mysite.com/blog/search/article-title/ return a 404.

    mysite.com/blog/article-title/ is working OK. I don't have any search file though. Maybe that's the problem.

    Anyone knows how to fix this?
     
  2. woot123

    woot123 Junior Member

    Joined:
    Jan 10, 2012
    Messages:
    113
    Likes Received:
    27
    You could put a 404.php in your theme directory and put the following in:

    PHP:
    <?php
    header
    ("HTTP/1.1 301 Moved Permanently");
    header("Location: ".get_bloginfo('url'));
    exit();
    ?>
    Then everytime you get a 404 it will be redirected to your homepage.
     
    • Thanks Thanks x 1
  3. Codythebest

    Codythebest Senior Member

    Joined:
    May 29, 2009
    Messages:
    1,138
    Likes Received:
    884
    Location:
    Fuerteventura
    Home Page:
    It works.
    But each indexed pages are now redirected to the blog homepage instead of their own article page
     
  4. woot123

    woot123 Junior Member

    Joined:
    Jan 10, 2012
    Messages:
    113
    Likes Received:
    27
    Maybe deactivating plugins can work for you too, see this:

    Code:
    wordpress  **  org/support/topic/searching-returns-404
    Change "**" to ".", an not allowed to post links yet.

    Tell me if it worked ;)
     
  5. Codythebest

    Codythebest Senior Member

    Joined:
    May 29, 2009
    Messages:
    1,138
    Likes Received:
    884
    Location:
    Fuerteventura
    Home Page:
    Unfortunately, it didn't work. I played with the plugins and still have that problem
     
  6. arpitagarwal82

    arpitagarwal82 Power Member

    Joined:
    Feb 20, 2008
    Messages:
    725
    Likes Received:
    465
    Location:
    Localhost
    Hello cody.. Nice to find you here on BHW.. I guess you were a very active member at DP few years back.

    Now for you problem:
    1) Check if mod rewrite is enabled. Make sure you have a htaccess file. Create a blank one if needed and then just go to permalink structure setting and click save button.

    2) If that does not solve problem, try using this plugin
    http://wordpress.org/extend/plugins/smart-404/

    It redirects the 404 error page to most appropriate page on your site.