301 Redirects

#1
Hi All,
We keep seeing issues on our platform in that when we switch to litespeed users with 301 redirects often see them stop working. Upon checking the redirects they are using the correct regex so should work yet they don't for some reason. The most recent was a user who had a number of 301 redirects for their store, two of which are below:

Code:
Redirect 301 /shop/designer-clip-on-earrings-57/ /shop/index.php?cPath=57
Redirect 301 /shop/designer-clip-on-earrings-57/adele-marie-designer-earrings-60/ /shop/index.php?cPath=57_60
What was happening is that while this used to work in Apache, the switch to litespeed was causing the redirect to malform into:

/shop/index.php?cPath=57adele-marie-designer-earrings-60/

This seemed to be because the first redirect wasn't using the regex to match only "/shop/designer-clip-on-earrings-57/" as such I modified it as follows:

Code:
Redirect 301 ^/shop/designer-clip-on-earrings-57/?$ https://www.DOMAINREMOVED.co.uk/shop/index.php?cPath=57
Redirect 301 /shop/designer-clip-on-earrings-57/adele-marie-designer-earrings-60/ /shop/index.php?cPath=57_60
Now from my understanding that should do the trick and while the other redirects work fine now it seems the redirect for the base directory "/shop/designer-clip-on-earrings-57/" no longer functions and simply 404's. I can't see why this would fail as the redirect should be correct but for some reason it just doesn't acknowledge or run the redirect at all.

Any suggestions on this would be appreciated!

Regards,
Chris.
 
#3
how about exchange the order of the 2 redirect, will it work as expected ?
just to collect more info
Sorry for the late reply! I did try this during my initial testing and found it made no difference at all, for whatever reason the redirect simply wouldn't work as expected and still doesn't work 100% so there does seem to be some sort of issue with the way litespeed is handling the redirect. Note that these all worked fine with Apache so the users site has not been functioning correctly for quite some time.
 

Tishu

Well-Known Member
#4
Hello,

Try this:
Code:
Redirect 301 /shop/designer-clip-on-earrings-57/adele-marie-designer-earrings-60/ https://domain.com/shop/index.php?cPath=57_60
Redirect 301 /shop/designer-clip-on-earrings-57/ https://domain.com/shop/index.php?cPath=57
(change domain.com with your domain name).
 
Last edited by a moderator:
#5
Hello,

Try this:
Code:
Redirect 301 /shop/designer-clip-on-earrings-57/adele-marie-designer-earrings-60/ https://domain.com/shop/index.php?cPath=57_60
Redirect 301 /shop/designer-clip-on-earrings-57/ https://domain.com/shop/index.php?cPath=57
(change domain.com with your domain name).
So that's basically what I've tried already but test this it simply fails and redirects to:

/shop/index.php?cPath=57adele-marie-designer-earrings-60/

If i comment out the second 301 redirect from what you provided it works but of course then the redirect against the main address doesn't work so it's either I get all the sub pages working or I can have the main redirect working but none of the pages underneath.

It's a bit odd as to why this doesn't work but it's literally specific to when we run litespeed on the server which is a pain.
 
Top