I’ve setup .htaccess rules for webmail.domain.ltd so that it redirect to domain.ltd/snappmail,
the redirect rules works but instead of launching snappmail it access the wordpress site which installed the root dir of the domain.
### Rewrite Rules Added by CyberPanel Rewrite Rule Generator
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
### End CyberPanel Generated Rules.
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^$ https://domain.ltd/snappymail? [R=301,L,NC]
and follow it accordingly. There must be another rewrite rule that conflicting with this one.
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^$ https://serverdomain.com/snappymail? [R=301,L,NC]
RewriteRule ^$ https://serverdomain.com/snappymail? [R=301,L,NC]: This line defines the redirection rule. If the query string is empty, the request will be redirected to the snappymail page on the serverdomain.com domain with a 301 Moved Permanently status, a Location header, and no cache.
@josephgodwinke
I think that .htaccess in root directory of the domain.ltd which in turn host the wordpress code, is acting and passing ‘/snappymail’ path to wordpress which in turn causes a page not found!.