Redirect http to secure https url for a specific domain name

We had a wildcard certificate * We have other website too hosted on the same server like
Now we don’t have a certificate for so, we want to redirect when someone types to

So when a user types they should be redirected to But should not redirect to instead of the fact that they both are hosted on same server and share same .htaccess file.

Here is the solution: (add this in your main root .htaccess file)
RewriteCond %{HTTPS} !on
RewriteCond %{SERVER_NAME} ^(.*
RewriteCond %{REQUEST_URI} !^(.*.wsdl) ##bypass wsdl file calls
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s