Select Category
Sitemap Help Contact
print article

Redirect Traffic to Your SSL Secured Site

For Hosting packages

Before you begin, you should first Set Up a Dedicated SSL Certificate on your domain.

For Linux Packages
You will need to either create a .htaccess file in the root of your webspace or if you already have one, edit the file. Take a look at the example below for reference.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.1and1help\.com$ [NC]
RewriteRule ^(.*)$ https://www.1and1help.com/$1 [R=301,L]


A few notes:
  • You must add the line RewriteEngine On to enable rewrite rules. Do not add this line a second time if it is already present in the .htaccess file.
  • Replace 1and1help.com in the example above with your own domain.
  • The last line must contain the correct domain or subdomain that is used with the SSL. This may be yourdomain.com, www.yourdomain.com or subdomain.yourdomain.com.

For Windows Packages
You will need to write a redirect script, that redirects all requests to your website to https://

<%EnableSessionState=False
host = Request.ServerVariables("HTTP_HOST")

if host = "yourdomain.com" or host = "www.yourdomain.com" then
response.redirect("https://www.yourdomain.com/")

else
response.redirect("https://www.yourdomain.com/error.htm")

end if
%>

This script needs to be named default.asp and placed in the folder your domain is pointing to.

For additional information, you may want to reference: