Knowledgebase

PraHost is a web hosting company founded in 2008, with four leased data center facilities located in Germany and Netherlands.

Knowledgebase

How do i force SSL / HTTPS in an .htaccess file Print

  • 0

The regular internet traffic to your website is done via http: //. When an SSL certificate is linked to your web hosting package internet traffic done via https. You can force this with an .htaccess file. 

For example, the http: // traffic is converted to https: // and there is a secure connection.

1. Create an .htaccess file

Create an .htaccess file, preferably via a text editor. Pay attention to the naming:  .htaccess

2. Add the rewrite code

Within the text editor add the following rewrite code.

RewriteEngine OnRewriteCond% {HTTPS}! = OnRewriteRule ^ https: //% {HTTP_HOST}% {REQUEST_URI} [L, R = 301]

3. Place the .htaccess file online

Then put the .htaccess file online within the / httpdocs.


Was this answer helpful?

« Back