Redirect 301 on a WHM Litespeed server and Easy Apache Configuration

Litespeed Guide:

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]

Apache Guide

cat /etc/apache2/sites-available/webmail-redirect.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
    Redirect 301 /
<VirtualHost *:80>
    Redirect 301 /


Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top