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: under SOFT 404 Errors Section in Crawl Errors.

This is what Google Suggested.

[COLOR=“#FF0000”]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.[/COLOR]

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

It is not working…

If anyone can help me it would be greatly appreciated!

Many Thanks,

The way I do it is to specify the “redirect” page as the “error document” in htaccess eg.

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”)

  } 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.