Trouble with 301 Redirects with CyberPanel/OLS

Hello,

New to using CyberPanel and currently using it with OLS. Some of my RewriteRules are working while others are not and I’m not really sure what the problem could be.

I’m waiting on our webhost IT to help but they have been a bit unhelpful by telling me that rewrites cannot happen with non-existent pages. That’s my understanding of what the redirects are for.

RewriteEngine On
RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteRule ^engineering/hose\-reel\.htm$ http://www.pacificmarine.net/engineering/industrial-metal-heavy-duty-hose-reel.htm [R=301,L,NC]

RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteRule ^marine\-deck/marine\-fenders/boat\-buoy\-cm\-series\.htm$ http://www.pacificmarine.net/marine-deck/marine-fenders/polyform-boat-buoy-cm-series.htm [R=301,L,NC]

I have a lot more rules for 301s but the above is an example of two. Can someone help me to understand why the first rule is not working but the second rule is?

I use the following generator to make these redirects and as far as I can tell there are no syntax errors in either of the rules above.

Please restart Openlitespeed by going to Cyberpanel option named under “Manage services” on left menu and then click on the openlitespeed restart button.

Openlitespeed needs a restart whenever vhost/htaccess files are modified… Thats an intentional/known drawback of openlitespeed when compared to litespeed enterprise. Litespeed enterprise being the paid plan doesnt have such limitations applied.

Hello @die2mrw007,

Thank you for the response. I have been rebooting OLS with every edit of these redirects. My host got back to me and believes there may be some limitation on the number of redirects that are supported by OLS. They tested the redirects on an Enterprise server they have and everything appeared to be working correctly.

If this is the case, we may just upgrade to LSE so we don’t have this issue

Not every htaccess rules are supported by Openlitespeed but rewrite and rewritecond rules are supported. You can also refer official documentation by Openlitespeed to alter the changes in code structure as required.