Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

Find us on Facebook

Follow us on Twitter

View our YouTube channel

 All Forums
 PHP (Unix / Linux / Apache) versions
 How to Configure .htaccess for Expired Products?
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic   

Advanced Member

354 Posts

Posted - 12/07/2019 :  09:29:59  
Hi, oftentimes because of a supplier issue, a product will change so significantly that it needs a new name, and a new product created in the Cart.

In the past, after creating the new product in the Cart, on the expired product's Admin page we clear the Sell Button checkbox, then add text and a link in the Long Description field to direct visitors to the new product URL.

Unfortunately Google continues to show high ranking results for those expired products - often for years. This brings a lot of new visitors to product pages with no Sell Button, and creates a lot of confusion.

1. Can anyone recommend the best .htaccess lines to redirect those visitors to the newer product URL?



Note: these URLs generally have long strings appended by the referring sites, so the redirects would need to keep those intact.

2. If there's a better way to accomplish this, or if there are any potential pitfalls, best practices, etc., for this type of change we'd be grateful to hear.

Thank in advance.

- Paul D.

Ecommerce Template Expert

United Kingdom
519 Posts

Posted - 12/07/2019 :  13:28:46  
I think a 301 permanent redirect for the no longer available product to the new product in the .htaccess file is the solution

Manchester, UK

Using ECT since 2004

Edited by - 1818charlie on 12/07/2019 13:29:42

Ecommerce Template Expert

829 Posts

Posted - 12/07/2019 :  15:54:34  
The proddetail page .htaccess URL redirect trick is here >>
Note that all your URL Redirects should be grouped together and appear near bottom of the .htaccess file, before Custom HTML Error Pages (if you have those).

The old product page should be hidden by removing the tick from the "Display Product" box.
Regenerate a new sitemap.xml file and submit to Google and Bing.


Advanced Member

354 Posts

Posted - 12/08/2019 :  05:29:05  
Perfect... thanks so much. Sorry I missed that 01/17/2017 post of yours. This definitely seems to work as desired.


How to redirect
www. example .com/proddetail.php?prod=SH-CRANK-KIT
www. example .com/proddetail.php?prod=SH-CRANK-NEW-KIT

Here are the ".htaccess" file entries that achieve the proddetail.php page redirect, as described in that example.
# ======================================================
# URL Redirects for proddetail.php pages
# ======================================================
RewriteCond %{QUERY_STRING} ^prod=SH-CRANK-KIT
RewriteRule ^proddetail\.php$ http:// www. example .com/proddetail.php?prod=SH-CRANK-NEW-KIT [R=301,L]

Just delete the spaces I put in the www. example .com URL above.

As suggested, you should then clear the Display Product checkbox on the old product's Admin page, update your sitemaps, etc.

Edited by - pauld on 12/08/2019 07:56:58
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2019
This page was generated in 0.03 seconds. Snitz Forums 2000