Redirecting HTTP to HTTPS

Apache Webserver

If you are using the popular Apache Web server, you can easily redirect all traffic from unsecured HTTP to HTTPS. When a visitor goes to your site will be redirected to the secure HTTPS protocol.

Logo Apache Web server

If you are a server administrator, you can do so in httpd.conf file using configuration below. If you are not an administrator and you use webhosting, you can set up redirect using .htaccess file. Put .htaccess with this configuration to the folder you want to redirect to HTTPS:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

The server must allow you to use module mod_rewrite, but it's not a problem for most webhosting providers.
If you do not want to redirect the entire site, but only one page , then use this configuration:

RewriteEngine On
RewriteRule ^apache-redirect-http-to-https.html$ [R=301,L]

Microsoft IIS 7 a IIS 8

On the Microsoft server you can use the IIS Web server to redirect any traffic using the following procedure.

Logo Windows Server

Server needs Microsoft URL Rewrite Module to be installed. Our process is performed after installing an SSL certificate and assigning it to a domain. Our videotutorial will help you with this task SSL certificate installation on IIS 7.

Check the SSL Settings option of your web site and make sure that you disable the Require SSL option.

Adjusting the Website in IIS 7
Paste the following code into the file web.config in the main directory of the site, which is the main XML configuration file for ASP.NET applications. <?xml version="1.0" encoding="utf-8" ?>
     <rule name="HTTP to HTTPS redirect" stopProcessing="true">
      <match url="(.*)" />
       <add input="{HTTPS}" pattern="off" />
      <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
More information about cinfoguring IIS you can find at Microsoft MSDN Library.

Then just visit your domain and test the functionality of the new redirect.


Logo nginx

To redirect server nginx add the bold line to the server configuration:

server {
listen 80;
rewrite ^ https://$server_name$request_uri? permanent;

server {
listen 443;

ssl on;


If necessary, please contact our customer support, which will help you to choose the certificate and will help with any questions.