Litespeed obeys .htaccess rules but I cannot seem to get it to work for what should be a basic problem for which I cannot find a solution online. I want to redirect from this with everything in the sub-directory:
to
What I have tried so far that does NOT work:
SETUP 1
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^/mail$
RewriteRule ^(.*)$ https://mail.example.com/$1 [R=301,L]
SETUP 2
RewriteRule ^mail/(.*)$ https://mail.example.com/$1 [R=301,NC,L]
SETUP 3
Redirect 301 /mail/ https://mail.example.com/
I have also tried another 5 things that don't work. The mail.example.com server is different from the one example.com/mail/ is sitting on.
EDIT TO ANSWER COMMENTS:
I have put the .htaccess file both in the root directory and the mail sub-directory but it does not redirect. By not working, I mean that the page just goes back to the original URL (example.com/mail/) instead of redirecting as expected.