II6 ISAPI - 404 Response Code
3 posts
• Page 1 of 1
II6 ISAPI - 404 Response Code
Hi,
I can't find an answer to this and so hope someone can help please:
Google is reporting "Soft 404" Errors whenever it crawls a PHP database URL that has been deleted from the web site- as the server isn't correctly responding with a 404 response code. All that happens is that the PHP web page code (on seeing there is nothing in the database ) generates a custom error page "error.html" which shows a HTTP 1.1 200 OK server response.
I guess I could do loads of permanent redirections to the home page but understand this is not SEO friendly so that seems out.
Is there anyway in PHP or IIS6 rewrite2 that I can get the server to respond correctly ?
(All the URLs in the database follow a similar format "/product.php?id=87 )
Thanks
Neil
I can't find an answer to this and so hope someone can help please:
Google is reporting "Soft 404" Errors whenever it crawls a PHP database URL that has been deleted from the web site- as the server isn't correctly responding with a 404 response code. All that happens is that the PHP web page code (on seeing there is nothing in the database ) generates a custom error page "error.html" which shows a HTTP 1.1 200 OK server response.
I guess I could do loads of permanent redirections to the home page but understand this is not SEO friendly so that seems out.
Is there anyway in PHP or IIS6 rewrite2 that I can get the server to respond correctly ?
(All the URLs in the database follow a similar format "/product.php?id=87 )
Thanks
Neil
Re: II6 ISAPI - 404 Response Code
Hello, Neil
Do you mean you want to get 404 status code whenever a non-existent product is requested?
I guess it's bot quite possible with ISAPI_Rewrite2 and you have to look into PHP settings.
Have a look at this post for ideas: http://wordpress.stackexchange.com/ques ... ted-to-404
Do you mean you want to get 404 status code whenever a non-existent product is requested?
I guess it's bot quite possible with ISAPI_Rewrite2 and you have to look into PHP settings.
Have a look at this post for ideas: http://wordpress.stackexchange.com/ques ... ted-to-404
Re: II6 ISAPI - 404 Response Code
Hello Anton,
Thanks again
Within the PHP file that writes both the product ads (and the actual error page) I replaced :
if ($item_exists == 0) {
?>
<p> sorry the product can't be found etc ..........</p>
WITH
if ($item_exists == 0) {
header("HTTP/1.0 404 Not Found", TRUE);
?>
<p> sorry the product can't be found etc ..........</p>
Have tested it and a 404 code is returned on products that don't exist and a 200 on the products that do exist. Google can't crawl the non existent products so all is fixed.
Many Thanks.
Neil
Thanks again
Within the PHP file that writes both the product ads (and the actual error page) I replaced :
if ($item_exists == 0) {
?>
<p> sorry the product can't be found etc ..........</p>
WITH
if ($item_exists == 0) {
header("HTTP/1.0 404 Not Found", TRUE);
?>
<p> sorry the product can't be found etc ..........</p>
Have tested it and a 404 code is returned on products that don't exist and a 200 on the products that do exist. Google can't crawl the non existent products so all is fixed.
Many Thanks.
Neil
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests