Forums / All Other Contributions/Addons / Page Not Found redirect not working for some of my deleted products

Page Not Found redirect not working for some of my deleted products

Locked

Started by all4coffee on 15 Aug 2010, 4:00 AM · Views: 2,204

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
15 Aug 2010, 4:00 AM
#1
all4coffee avatar

all4coffee

Zen Follower

Join Date:
Jul 2007
Posts:
154
Plugin Contributions:
0

Page Not Found redirect not working for some of my deleted products

I have a different sort of problem - all mistyped URL searches to my site show the page_not_found as they are supposed to and nicely returning 404 Not Found headers. Also products which have been removed from the catalog and redirected via .htaccess return either the 410 or 301 headers as needed.

The problem I couldn't find solution for is with the pages for products which have been removed from catalog but I don't want to redirect them with 301 or 410 if this can be helped. I imagine that since the deleted products don't exist anymore, typing their former URL would generate standard 404 Not Found header and display the page_not found without the need of redirecting them one by one.

Example 1 - accidental URL typed/mistyped returns 404 response:
http://www.all4coffee.com/xxxx

Example 2 - redirected in .htaccess, old directory returns 410:
http://www.all4coffee.com/gifts

BUT

Example 3 - removed product URL and not redirected in .htaccess (other than the line: ErrorDocument 404 /index.php?main_page=page_not_found) hangs in Browser and displays "Cannot display in Browser" message. Server header check shows however 200 OK. I checked database and confirmed that the product is not there anymore:
http://www.all4coffee.com/monin-banana-p-109.html

I don't understand why. Logically since the URL for the deleted product doesn't exist, the result should be 404 Not Found. Where am I wrong? I'm using ZenCart 1.37 and would appreciate your help. Thanks.

15 Aug 2010, 4:24 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,707
Plugin Contributions:
0

Re: Page Not Found redirect not working for some of my deleted products

Try asking whoever wrote your SEO addon.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

15 Aug 2010, 8:16 AM
#3
all4coffee avatar

all4coffee

Zen Follower

Join Date:
Jul 2007
Posts:
154
Plugin Contributions:
0

Re: Page Not Found redirect not working for some of my deleted products

Kim:

Try asking whoever wrote your SEO addon.

This is Ultimate SEO. I dids turn it off and the same problem continued. I also cleared browser's cache, renewed ipconfig, flushed DNS. It seems like removed products are kept somewhere in "memory" not generating 404 error but 200 header response. Any suggestions? Please...

15 Aug 2010, 8:51 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Page Not Found redirect not working for some of my deleted products

Several improvements were made in v1.3.9 to cause not-found products to trigger a 404 header response. I recommend upgrading.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Aug 2010, 10:24 PM
#5
all4coffee avatar

all4coffee

Zen Follower

Join Date:
Jul 2007
Posts:
154
Plugin Contributions:
0

Re: Page Not Found redirect not working for some of my deleted products

DrByte:

Several improvements were made in v1.3.9 to cause not-found products to trigger a 404 header response. I recommend upgrading.

I would rather not (my store works great and was so much customized that it would be a huge task). Is there any type of fix I could use to do it with v1.3.7?

15 Aug 2010, 11:58 PM
#6
all4coffee avatar

all4coffee

Zen Follower

Join Date:
Jul 2007
Posts:
154
Plugin Contributions:
0

Re: Page Not Found redirect not working for some of my deleted products

all4coffee:

I would rather not (my store works great and was so much customized that it would be a huge task). Is there any type of fix I could use to do it with v1.3.7?

All it needed was a header code on top of the tpl_product_info_noproduct.php

header("HTTP/1.1 410 Gone");

I chose to generate 410 Gone code vs. 404 Not Found since it seems more appropriate for the products which have been permanently removed from the catalog and which don't need to be redirected in .htaccess. Thanks for your help.