| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
301 Redirect not working in HTACCESS file | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
301 Redirect not working in HTACCESS file
We have a list of 301 redirects in the .htaccess file. They are simple rules written one on each line as so:
PHP Code:
These URLs are resolving like this and returning a 404 Page Not Found error: Code:
They seem to be redirecting properly and the final URL would be fine if the page wasn't 404'd. It looks like there is a rule in x-carts .htaccess file that appends a string to the URL if a certain file or directory does not exist from the URL. PHP Code:
What is the purpose of this rewrite? More importantly, how can I make the 301 Redirect rules work properly? Should I be trying a different route? Please help as this is urgent. Any insight is much appreciated. Thanks in advance.
__________________
Ant XC v5.3.1.8 Horizontal Flyout Categories Menu Module CloudSearch / CloudFilters XC v4.7.6 CloudSearch |
|||||||
#2
|
|||||||||
|
|||||||||
Re: 301 Redirect not working in HTACCESS file
These are for proper functioning of clean URLs.
* http://kb.x-cart.com/display/XDD/Setting+up+seo-friendly+URLs
__________________
Best regards, Igor Pudovkin X-Cart hosting team |
|||||||||
#3
|
|||||||
|
|||||||
Re: 301 Redirect not working in HTACCESS file
Igor,
Thanks for your reply. I understand that's what the rules are for, but that really doesn't help answer my question. How can I get the "Redirect 301" rules to work properly? Do you have any insight? What is the proper way add redirect rules to x-cart? Why are these pages not resolving when there is the query string at the end?
__________________
Ant XC v5.3.1.8 Horizontal Flyout Categories Menu Module CloudSearch / CloudFilters XC v4.7.6 CloudSearch |
|||||||
#4
|
|||||||||
|
|||||||||
Re: 301 Redirect not working in HTACCESS file
Try something like that
Code:
__________________
Best regards, Igor Pudovkin X-Cart hosting team |
|||||||||
#5
|
|||||||
|
|||||||
Re: 301 Redirect not working in HTACCESS file
Igor, this is perfect. I converted all of the redirects to that format and everything appears to be working great. Thanks for the suggestion.
__________________
Ant XC v5.3.1.8 Horizontal Flyout Categories Menu Module CloudSearch / CloudFilters XC v4.7.6 CloudSearch |
|||||||
|
#6
|
|||||||||
|
|||||||||
Re: 301 Redirect not working in HTACCESS file
Quote:
Glad I could help
__________________
Best regards, Igor Pudovkin X-Cart hosting team |
|||||||||
#7
|
|||||||
|
|||||||
Re: 301 Redirect not working in HTACCESS file
Please help,
having the same issue as the above poster. on all of my x-cart 4.x installs the standard Redirect 301 always has worked well. but in 5.2 it appends this strange stuff that makes the redirect fail. I have attempted to use: RewriteRule ^all\-products\/category(.*) "https\:\/\/www\.yoursite\.com\/all\-products\/category" [R=301,L] but is does not work for me. I am trying to re-point several directories for example: www.naturalbathbody.com/bath/bath-and-shower/ which now is: www.naturalbathbody.com/bath-and-shower/ the above code snipped may work well with .html pages, but I have tried multiple ways to format changing categories and it just will not work. can someone please post an example instead of the code snippet? that would really help. thanks in advance, Marc W.
__________________
Marc Washburn www.EverythingGraphic.com Running four successful X-cart 5.3.x installations and one 5.4.x |
|||||||
#8
|
|||||||||
|
|||||||||
Re: 301 Redirect not working in HTACCESS file
Could you please post here the exact rewrite rule that isn't working?
__________________
Best regards, Igor Pudovkin X-Cart hosting team |
|||||||||
#9
|
|||||||
|
|||||||
Re: 301 Redirect not working in HTACCESS file
Quote:
This is a very normal 301 redirect: .htaccess last line: Redirect 301 /Natural-Shaving-Gel.html https://www.naturalbathbody.com/apollon-shaving-gel.html The redirect is picked up and if you go to page: http://www.naturalbathbody.com/Natural-Shaving-Gel.html the it jumps to this page: https://www.naturalbathbody.com/apollon-shaving-gel.html?url=Natural-Shaving-Gel&last=&rest=&ext=.html but of course this page does not exist and the extra garbage that is appended causes a 404 error. please help ... maybe you can show me an example of how that 301 code above has to be structured in X-cart 5.2.15... thank you in advance Marc
__________________
Marc Washburn www.EverythingGraphic.com Running four successful X-cart 5.3.x installations and one 5.4.x |
|||||||
#10
|
|||||||||
|
|||||||||
Re: 301 Redirect not working in HTACCESS file
I would try with the dynamic url instead
Redirect 301 /Natural-Shaving-Gel.html https://www.naturalbathbody.com/cart.php?target=product&productid=XX example for a product page
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|