SubDomain Redirects to Root (possible htaccess problem)

I created a new subdomain but when I go to it at:

http://sub.domain.com

it works. But if I go to it at:

https://sub.domain.com

it redirects me to the root domain. I think it has something to do with my htaccess in the root domian.

Can someone who understands htaccess have a look at the below code and see if there is anything that would cause this?

    RewriteEngine On
    RewriteRule ^(.*)local.xml$ - [F,L]	
    RewriteCond %{THE_REQUEST} ^.*/index.php
    RewriteRule ^(.*)index.php$ https://www.mydomain.com/$1 [R=301,L]
  
    RewriteCond %{HTTP_HOST} ^mydomain.com
    RewriteRule (.*) https://www.mydomain.com/$1 [R=301,L]	
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]
    RewriteCond %{HTTP_HOST} ^11\.11\.11\.111
    RewriteRule (.*) https://www.mydomain.com/$1 [R=301,L]
    RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
    RewriteRule .* ? [F,L]
   

Thank you

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.