My goal is to redirect all http and www URLs to https://non-www
To this end, I have written the following lines to .htaccess:
While this works perfectly on an Apache server, this fails for redirects from https://www on a LiteSpeed server. (I use web hosting, so I do not have root access).
On https://www.litespeedtech.com/docs/webserver/config/rewrite it says: 'The implementation of LiteSpeed's rewrite engine follows the Apache's rewrite engine specifications.'
So is this a bug? If not, what can I do to achieve the goal above?
Thanks!
To this end, I have written the following lines to .htaccess:
Code:
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R,L]
On https://www.litespeedtech.com/docs/webserver/config/rewrite it says: 'The implementation of LiteSpeed's rewrite engine follows the Apache's rewrite engine specifications.'
So is this a bug? If not, what can I do to achieve the goal above?
Thanks!
Last edited by a moderator: