SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2006
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Google Reported SOFT 404 Errors: Unable to 301 Redirect via .htaccess file

    Hi there,

    I'm working on a client's new redesigned website which runs on Magento. The old website's product pages used Query Strings. The complete site was design using PHP/MySQL.

    I observed the following error in the Google Webmaster Tools
    Google detected a significant increase in URLs we think should return a 404 (Page Not Found) error but do not.

    One of the URL's that were detected was - URL: http://www.pudu.com.au/?pcode=GAUCHO under SOFT 404 Errors Section in Crawl Errors.

    This is what Google Suggested.

    The target URL does not exist and your server is not returning a 404 (file not found) error. More info.

    Your server returns a code other than 404 or 410 for a non-existent page (or redirecting users to another page, such as the homepage, instead of returning a 404). This creates a poor experience for searchers and search engines.


    I want to 301 redirect this page and other like pages to the Homepage now.

    I am trying to do this in .htaccess

    redirect 301 ?pcode=GAUCHO http://www.pudu.com.au/

    It is not working...

    If anyone can help me it would be greatly appreciated!

    Many Thanks,
    Hemanth
    Last edited by Mittineague; Nov 29, 2013 at 22:33. Reason: delinking example URLs

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    The way I do it is to specify the "redirect" page as the "error document" in htaccess eg.
    Code:
    ErrorDocument 404 /whatever.php?status=404
    Then in "whatever.php" I test for the GET variable (you could use other than "status" and/or "404")
    Code PHP:
    .....
      } else if($_GET['status']=="404"){
    header("HTTP/1.0 404 Not Found");
    .....

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2006
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    The way I do it is to specify the "redirect" page as the "error document" in htaccess eg.
    Code:
    ErrorDocument 404 /whatever.php?status=404
    Then in "whatever.php" I test for the GET variable (you could use other than "status" and/or "404")
    Code PHP:
    .....
      } else if($_GET['status']=="404"){
    header("HTTP/1.0 404 Not Found");
    .....
    Thanks for replying.

    But now the Site runs on Magento and the file structure is completely different.

    The old .php files no longer exist.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •