Redirect 301 on a WHM Litespeed server

When we tried to set up redirection on what is a default WHM Litespeed installation, we had a ton of trouble. In theory Litespeed uses Apache .htaccess format, so we set up looking for information on both Apache and Litespeed.

None of the “common” redirect rules worked, and then after much Googling it started feeling like actually there is no “default” redirect rules. Of the three sets below, only the top one worked reliable.

Go figure, redirecting turns out to be super complicated.

# Enable redirect engine
RewriteEngine On

# Top set
Redirect 301 /knowledgebase/
Redirect 301 /knowledgebase-tag/
Redirect 301 /knowledgebase-category/

# Middle set
RedirectMatch 301 ^/knowledgebase/(.*)$$1 [L,R=301]
RedirectMatch 301 ^/knowledgebase-tag/(.*)$$1 [L,R=301]
RedirectMatch 301 ^/knowledgebase-category/(.*)$$1 [L,R=301]

# Bottom set
RewriteRule ^/knowledgebase/(.*)$$1 [L,R=301]
RewriteRule ^/knowledgebase-tag/(.*)$$1 [L,R=301]
RewriteRule ^/knowledgebase-category/(.*)$$1 [L,R=301]


Share this article

Leave a Reply

Your email address will not be published.

Scroll to Top