Reputation: 7788
I have two subdomains like schools.mydomain.co.uk
and admin.mydomain.co.uk
,I need to add https://
for all request url for both two domains,I have change my .htaccess
like as follows.These two subdomains pointing to the same root folder.
but gettiong an error "This webpage has a redirect loop"
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^admin\.mydomain\.co\.uk [NC]
RewriteRule (.*) https://admin.mydomain.co.uk/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^schools\.mydomain\.co\.uk [NC]
RewriteRule (.*) https://schools.mydomain.co.uk/$1 [R=301,L]
Upvotes: 0
Views: 58
Reputation: 80657
You are not checking whether they are already being accessed using HTTPS
:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTPS} ^off
RewriteCond %{HTTP_HOST} ^(admin|schools)\.mydomain\.co\.uk [NC]
RewriteRule (.*) https://%1.mydomain.co.uk/$1 [R=301,L]
Upvotes: 1