Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Avoid and Prevent "Product Not Found" on product info page


mommaroodles

Recommended Posts

I dont like the fact that if a person does happen to click on a non existant product that they get the

 

"Product not Found" on the product info page so what I have done is the following

 

I've changed the following on product_info.php

 

if ($product_check['total'] < 1) {
?>
<div class="contentContainer">
<div class="contentText">
<?php echo TEXT_PRODUCT_NOT_FOUND; ?>
</div>
<div style="float: right;">
<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
</div>
</div>
<?php

 

to this

 

if ($product_check['total'] < 1) {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

} else {
$product_info_query = ..........

 

you can actually redirect the page to where ever you want it to go

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

i see this situation in google webmaster tools where it lists products with no title tags. i was thinking about redirecting to a 404 page so that would be eventually flushed out of googles cache. i'm not sure what google with do with those pages in the long run if redirected to the main page though.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

I dont know if ppl are still using the All Products Addon, but I'd redirect it there An actual page is better than a 404 page imho :)

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

i see the point of keeping the visitor on the site. i was going along the line of if a 404 isn't generated then won't google keep that non existent page in cache if it's redirected in site to say all products or index? so maybe a 404 with a custom page telling the visitor "oops..sorry this page no longer exists. please go to (insert site url) to see other products you might like.

 

i think jack_mcs has something along these lines as an add on i just recalled.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Yes, it is called the Header Status Handler. I also suggest installing the Custom Error addon since all sites should have custom error pages. They not only keep customers on the site but cut down on server load and bandwidth usage.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs Personally I would not add ability to add 410 Header status to any of my unmatched urls but rather do a 301 redirect and in fact it is highly recommended to use a 301 redirect as opposed to a 410.

 

According to seomoz.com and status headers and I'd like to quote the following from their site www.moz.com/learn/seo/http-status-codes:

 

Important HTTP Status Codes for SEOs and search engines

 

200 OK

 

The request has succeeded. This is considered correct for most scenarios.

301 Moved Permanently

 

The requested resource has been assigned a new permanent URI and any future references to this resource should use one of the returned URIs. The 301 redirect, as it is commonly called by SEOs, should be utilized any time one URL needs to be redirected to another.

302 Found

 

The server is currently responding to the request with a page from a different location, yet the requestor continues to use the original location for future requests. This approach is not recommended. It is not an effective way to instruct search engine bots that a page or site has moved. Using 302 will cause search engine crawlers to treat the redirect as temporary and not give it the link juice (ranking power) abilities of 301 redirects.

404 File Not Found

 

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. This should occur any time the server can’t find a matching page request. Often times webmasters will display a text 404 error but the response code is a 200. This tells search engine crawlers that the page has rendered correctly and many times the webpage will get erroneously indexed.

410 Gone

 

The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval. If the server does not know–or has no facility to determine–whether or not the condition is permanent, the status code 404 (Not Found) should be used instead of 410 (Gone). This response is cacheable unless indicated otherwise.

503 Service Unavailable

 

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The 503 should be used whenever there is a temporary outage (for example, if the server has to come down for a short period for maintenance). This ensures that the engines know to come back soon because the page/site is only down for a short time.

SEO Best Practice

 

Using 301 Redirects

 

301 redirects are recommended when redirecting sites or pages. This is because 302 redirects do not instruct search engine crawlers that a page or site has permanently moved. For additional resources on implementing 301 redirects, see Jen Sable Lopez's guide on URL Rewrites and 301 Redirects.

 

 

Their Top Tips

 

Top Tips

  • Use 301 redirects rather than 302 redirects when redirecting URLs on a site to ensure that link juice (ranking power) is passed between the redirecting web pages.
  • Web pages that return 404 (File Not Found) for extended periods of time and that have valuable links should be 301 redirected to other web pages.
  • It is important to have customized 404 pages with recommended navigational options when website visitors request pages that return a 404 response code.

.

 

The one most appropriate time to use a 410 if for example your sell your web site - you can create a custom 410 page to let real visitors know that the domain/site has been sold and is 'GONE'

 

You must use a 404 or 410 status to have a URL removed. 404 means that the URL doesn't exist on your site. 410 means that the URL used to exist, but is no longer available. If the URL responds with 301, you are saying that the page has moved permanently to a different URL, which is a very different thing. The best thing to do is to decide which response code is the most appropriate for the page in question, and then consider how the search engines respond to each before proceeding, but in my own personal opinion and from what i've learnt over the years from experience is to rather use a 301 because ultimately google will crawl the page it was redirected to PR or link weight is not entirely lost.

 

410 = no page rank or link weight

 

watch this you tube video by Matt Cutts - the man himself from Google.

 

www.youtube.com/watch?v=Filv4pP-1nw

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

301 is not quite correct for the scenario as the product page has not moved;

eg: product_info.php?products_id=10 has moved to product_info.php?products_id=15

In that scenario, a 301 is 100% correct.

 

In the scenario of a "product not found", more correct than a 301 would be 404 or 410.

Link to comment
Share on other sites

@@mommaroodles If your goal is to keep your page rank the same, then issuing a 301 will work. So will doing nothing for that matter. But the benefits of that are so small, that it really isn't worth considering. Please keep in mind that the 301 only has meaning to google if you are considering PR and only then if there is a link to that page from another site, not from google. People that find the links won't know the difference, other than where they end up on. The correct response for a product that isn't found is either a 404 or a 410. If your site has a lot of those missing products, take a look in webmaster tools and you'll most likely see many soft 404 errors. Those will hurt you more than any PR loss.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

all my products are in categories and belong to manufacturers.

I show the essential info about the product requested without pricing and tell the customer that the product is no longer stocked or sold (depending on the actual status of the product) and show the customer other products in the same category with a possibility to filter the results to just the ones from the same manufacturer. To me that is the closest response to what they were looking for in the first place.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...