You are Here: FAQ ->Dedicated Servers->Linux Root Server->SSL Certificates->Article #7


Host name redirects


If you have ordered and installed an SSL certificate on root server you will need to setup a redirect whether you have ordered that SSL for the www subdomain or not. This is because the SSL certificate is only for one domain name and www.domain.com and domain.com are technically two different names. There are a number of different ways to accomplish this. The method described below is one method of accomplishing this. The method below uses a .htaccess file and mod rewrite rules.

If you ordered the SSL without the www then the content you will need to add this to your current .htaccess file or to a new .htaccess file


RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.doamin.com [NC]
RewriteRule ^(.*)$ http://domain.com [L,R=301]



and replace domain.com wth your domain name.

If you ordered the ssl with www then you will need to add this to your current .htaccess file or to a new .htaccess file


RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com [L,R=301]



and replace domain.com with your domain name.

If you already have a current .htaccess file and already have the line

RewriteEngine On

you do not need to add this a second time. You only need to turn the rewrite engine on once. So if the rewrite engine line is in your existing .htaccess file then add the rewrite rule and rewrite condition after the line where the rewrite engine is turned on.

If you want everything on the site to use https then see this faq How to set up a website that is only accessible using SSL. (https://).


Print Article
How useful was this article?
(From 5 = Very Useful to 1 = Not useful at all):
1 2 3 4 5