1and1 Help Centre Categories

print article

Redirect Traffic to an SSL Secured Site

Follow the steps below to set up a redirect to forward traffic to your SSL secured domain.

As a prerequisite, first install an 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\.domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
  • 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 yourdomain.com in red 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/index.html")

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: