X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   301 Redirect not working in HTACCESS file (https://forum.x-cart.com/showthread.php?t=73147)

mgwashburn 07-26-2016 07:40 AM

Re: 301 Redirect not working in HTACCESS file
 
Thank you, that worked...

I actually went to the page and noticed that by default after clicking on the link after finding it during an on page search I got this:

https://www.naturalbathbody.com/apollon-shaving-gel.html?category_id=24

I then added the '?category_id=24' to the 301 redirect statement and then it worked.

So I assume your idea of putting in the product id number would also work.

thank you so much for you help,

very much appreciated,

Marc W.

cflsystems 07-26-2016 07:54 AM

Re: 301 Redirect not working in HTACCESS file
 
You don't want to do this really. The way XC adds this extra to the html url is really ugly and I wouldn't want my urls indexed like that. Use the target=product version instead so you can get a clean html url.

kevinrm 07-27-2016 02:01 AM

Re: 301 Redirect not working in HTACCESS file
 
If you want to simplify your life, there is a pretty good redirect module for XC5. I've been using it, I like it.

qualiteam 07-27-2016 04:35 AM

Re: 301 Redirect not working in HTACCESS file
 
Quote:

Originally Posted by mgwashburn
I actually went to the page and noticed that by default after clicking on the link after finding it during an on page search I got this:

https://www.naturalbathbody.com/apollon-shaving-gel.html?category_id=24

I then added the '?category_id=24' to the 301 redirect statement and then it worked.


I guess the product is added to a number of categories at the same time, that's why XC5 adds an extra param to track which category you came from to the page.

It should work without the category_id param as well (moreover, the "canonical" meta tag has no the parameter).

But what Steve says is a different thing. He advises you not to add product_id to the tail of your clean URL, but replace "appolon-shaving-gel.html" with the non-cleanURL version (?target=product&product_id=...).
This makes sense as after all rewrites the script works with this version of the URL anyway.

Quote:

Originally Posted by kevinrm
If you want to simplify your life, there is a pretty good redirect module for XC5. I've been using it, I like it.



I guess you mean this third-party module:
http://market.x-cart.com/addons/xcart-redirects-by-Nova-Horizons.html


All times are GMT -8. The time now is 02:36 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.