You are Here: FAQ ->Domains->SSL->Article #6


How to set up a website that is only accessible using SSL. (https://)


Applicable to Linux Packages only.
You should first have an SSL certificate installed on your domain.
Create a file named .htaccess in the directory your domain is pointing to and place
the following code:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.domain.com/$1 [R]

(substitute www.domain.com with your domain)

Note: Domains can have SSL certificates installed on www.domain.com or just
domain.com. Please check what you have and then substitute it accordingly.
(https://www.domain.com/$1 [R] or https://domain.com/$1 [R])

Applicable to MS Packages only.
You should first have an SSL certificate installed on your domain.
Write a redirect script, that redirects all requests to your website to https://

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

if host = "usa-test.com" or host = "www.usa-test.com" then
response.redirect("https://www.usa-test.com/index.html")

else
response.redirect("https://www.usa-test.com/error.htm")

end if
%>


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


Disclaimer: 1&1 provides the scripts and related information on this page as a courtesy, subject to 1&1's General Terms and Conditions of Service (the "GT&C"). As set forth in more detail in the GT&C, the scripts and information are provided "as-is", without any warranty, and 1&1 is not liable for any damages resulting from your use of the scripts or information.


SD1B1306


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