Hello,
I have main domain (DOMAIN.LTD) root directory at /home/user/public_html/
and sub domain (SUB.DOMAIN.LTD) root directory at /home/user/public_html/sub.domain.ltd/
and from WHM, i force it to use public_html as document root.
at the main domain, i have .htaccess like bellow:
this htaccess will force to use https://www.domain.ltd
The problem is, that htaccess will override root directory from SUB.DOMAIN.LTD
and it will force the SUB.DOMAIN.LTD to be https://www.sub.domain.ltd
and will make auto SSL fail to obtain certificate for https://sub.domain.ltd
is there a way to fix this problem without unforce to use public_html ?
I have main domain (DOMAIN.LTD) root directory at /home/user/public_html/
and sub domain (SUB.DOMAIN.LTD) root directory at /home/user/public_html/sub.domain.ltd/
and from WHM, i force it to use public_html as document root.
at the main domain, i have .htaccess like bellow:
Code:
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# First rewrite to HTTPS:
# Dont put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
The problem is, that htaccess will override root directory from SUB.DOMAIN.LTD
and it will force the SUB.DOMAIN.LTD to be https://www.sub.domain.ltd
and will make auto SSL fail to obtain certificate for https://sub.domain.ltd
is there a way to fix this problem without unforce to use public_html ?