apache subdomains

i am trying to use an apache subdomain. it is working fine like this with just http://

http://subdomain.mydomain.com

but it is not working using https://

https://subdomain.mydomain.com

here is my [dot]access file:

RewriteRule ^subdomain https://mydomain.com/myScript.php [L]
.....................................
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
i suspect the solution is something very simple. any suggestions?
 

Quags

Administrator
Staff member
Is there an ssl certificate?

Is the site behind cloudflare (redirect would be different)

It could just be

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