You are Here: FAQ ->Scripting and Programming Languages->Configuring Apache Webserver using .htaccess->Article #7


WebHosting 5.0 This article is for 1&1 Linux WebHosting only.


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



You should first have a 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} ^80$
RewriteRule ^retail/register/$ https://test.com/retail/register/ [R,L]

(substitute test.com with your domain name)

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

Note: When ordering your SSL please be sure to decide if you want to have your domain with or without the www prefix. Some software applications may require one or the other. After an SSL is setup you can not change the domain name.


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