Hello!
Let me explain my problem.Nobody can answer this,and now im here
1x Main-Domain (SSL) public_html/FILES
1x Addon-Domain (SSL) public_html/DOMAIN.COM <(Files inside)
The Main-Domain have one .htaccess to force ssl - this works here are no problems.
But all non SSL visitors on the Addon-Domain get a redirect to the Main-Domain
Some hours later i found some ways to exlude the Addon-Domain from the .htaccess rules.
But witch is the best way ?
1. Force SSl for the second Domain
2.Exclude the second Domain on the "main" htaccess
3. I use a shared host, what can my provider do,to "split" this two Domains?
Thanks!
Let me explain my problem.Nobody can answer this,and now im here
1x Main-Domain (SSL) public_html/FILES
1x Addon-Domain (SSL) public_html/DOMAIN.COM <(Files inside)
The Main-Domain have one .htaccess to force ssl - this works here are no problems.
But all non SSL visitors on the Addon-Domain get a redirect to the Main-Domain
Some hours later i found some ways to exlude the Addon-Domain from the .htaccess rules.
But witch is the best way ?
1. Force SSl for the second Domain
PHP:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
2.Exclude the second Domain on the "main" htaccess
PHP:
### RewriteEngine On ###
<IfModule mod_rewrite.c>
RewriteEngine On
### http -> https ###
RewriteCond %{HTTP_HOST} ^(www\.)?SECOND-DOMAIN\.com$
RewriteRule ^.*$ '-' [L]
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule (.*) https://MAIN-DOMAIN.COM%{REQUEST_URI} [R=301,L]
### Rewrite application ###
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule ^(.*)$ index.php?$1 [L,QSA]
### Close RewriteEngine ###
</IfModule>
<Files 403.shtml>
order allow,deny
allow from all
</Files>
3. I use a shared host, what can my provider do,to "split" this two Domains?
Thanks!
Last edited by a moderator: