强制SSL服务器和子域崩溃

www.miinik.com - domain

www.jingjingna.com - subdomain

I have tried most of the htaccess code to force SSL, but it keep causing a redirect loop. So I got this code from the internet applied it through plugin, WOW! it is now working perfectly... for miinik.com. Sadly, I log into jingjingna.com and now all the setting from miinik.com applied it to jingjingna.com(it suppose to be a completely different site). The problem could be from the php code or htaccess(miinik.com) *PS I have not edit jingjingna htaccess

<?php
if (stripos(get_option('siteurl'), 'https://') === 0) {
    $_SERVER['HTTPS'] = 'on';

    // add JavaScript detection of page protocol, and pray!
    add_action('wp_print_scripts', 'force_ssl_url_scheme_script');
}

function force_ssl_url_scheme_script() {
?>
<script>
if (document.location.protocol != "https:") {
    document.location = document.URL.replace(/^http:/i, "https:");
}
</script>
<?php
}

---------------------miinik htaccess------------------------------

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

</div>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://wwww.miinik.com%{REQUEST_URI} [R,L]

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://www.jingjingna.com%{REQUEST_URI} [R,L]

Here you go, just have 2 different .htaccess files on the domains.

I went and check jingjingna htaccess and it look like this

RewriteEngine off
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress


I guess I have to "RewriteEngine On" and use the code

RewriteEngine On
RewriteCond %{HTTPS} !=off
RewriteRule (.*) http://www.jingjingna.com%{REQUEST_URI} [R,L]

because this site doesn't have SSL but instead it got force from jingjingna. So now I have to manually edit the htaccess, which in this case is not the best solution. I wonder if someone can edit the php code above to work just the domain, not subdomain that would be great.

</div>