
RewriteOptions inherit

RewriteEngine on

### Note: Apparently this does not work for Webmail. Look up logs in Notion
# Redirect webmail.longan.digital to https for Webmail only
# RewriteCond %{HTTPS} !on 
# RewriteCond %{HTTP_HOST} ^webmail\.(.+)$ [NC]
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

###
# RewriteCond %{HTTP_HOST} !^/[0-9]+\..+\.cpaneldcv$ 
# RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ 
# RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ 
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
###

# Redirect anything else including www on longan.digital to https://longan-digital.com
RewriteCond %{HTTP_HOST} ^(www\.)?longan\.digital(.+)*$
# EXCEPT (i.e. not -> !) if path (REQUEST_URI) matches /go (for YOURLS), so if it does, the URL will remain longan.digital and not be re-written - Added replacing WHMCS on 19 Oct 2022
RewriteCond %{REQUEST_URI} !^/go
RewriteCond %{REQUEST_URI} !^/help
RewriteRule ^(.*)$ https://longan-digital.com/ [R=301,L]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php80” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
