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

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 How to Configure .htaccess for Expired Products?
Author « Topic »  

pauld
Advanced Member

USA
460 Posts

Pre-sales questions only
(More Details...)

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?

From:

https://www.example.com/proddetail.php?prod=Expired-Red-Product

to:

https://www.example.com/proddetail.php?prod=New-Green-Product

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.

1818charlie
ECT Moderator

United Kingdom
1179 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

Steve
Manchester, UK

Using ECT since 2004

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

ITZAP
Ecommerce Template Guru

Australia
1007 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.

Gary

pauld
Advanced Member

USA
460 Posts

Pre-sales questions only
(More Details...)

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.

Quote:

How to redirect
www. example .com/proddetail.php?prod=SH-CRANK-KIT
to
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
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000