Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

301 Redirect not working in HTACCESS file

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #11  
Old 07-26-2016, 07:40 AM
 
mgwashburn mgwashburn is offline
 

Advanced Member
  
Join Date: Sep 2013
Posts: 82
 

Default 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.
__________________
Marc Washburn
www.EverythingGraphic.com
Running four successful X-cart 5.3.x installations and one 5.4.x
Reply With Quote
  #12  
Old 07-26-2016, 07:54 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,189
 

Default 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.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #13  
Old 07-27-2016, 02:01 AM
 
kevinrm kevinrm is offline
 

X-Wizard
  
Join Date: Aug 2003
Posts: 1,003
 

Default 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.
__________________
X-Cart 5.4.1.39 Live
PHP 7.4.33
5.5.5-10.3.38-MariaDB MariaDB
Apache 2.4
CENTOS 7.8 64Bit Single Quad-Core E3-1241v3 3.4Ghz 8M 1600 w/ HT
32GB RAM 2x 512GB Samsung 850 Pro SSD RAID 1
Reply With Quote
  #14  
Old 07-27-2016, 04:35 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:59 AM.

   

 
X-Cart forums © 2001-2020