Da11aS
Da11aS

Reputation: 465

Changing Subdomain from HTTPS to HTTP

Currently my main GoDaddy account has an SSL certificate, so by default all of my sites below automatically try and start with https://

So I have this in my htaccess file for all of my sites below and it works fine.

# All urls have www. in them
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomainname\.com
RewriteRule ^(.*)$ http://www.mydomainname.com/$1 [R=permanent,L]

However when i try and do a subdomain, ie

# Sub Domain Rewrite
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subname\.mydomainname\.com
RewriteRule ^(.*)$ http://subname.mydomainname.com/$1 [R=permanent,L]

It doesn't seem to work, any ideas?

Upvotes: 1

Views: 94

Answers (1)

anubhava
anubhava

Reputation: 785541

Ok so it seems you need to place this rule in accord/.htaccess:

RewriteEngine On

# Sub Domain Rewrite    
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^subname\.mydomainname\.com$ [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L]

Upvotes: 1

Related Questions