Your location:FAQ > Hosting > Website Management
Redirect http to https

Redirect http to https


To redirect website http to https, create or edit your .htaccess (Unix hosting service) or web.config (Window hosting service), then upload it under public_html folder.


***Unix Hosting Service Website***


Download the existing .htaccess file, add the following, then upload it.

If the .htaccess has set other website rewrite, to prevent website error, contact your programmer to add for you.


RewriteCond %{HTTPS} off

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}



If no .htaccess file, use text editor to create one, then add the following


RewriteEngine on

RewriteCond %{HTTPS} off

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


***Window Hosting Service Website***


Download the web.config file, add the following, then upload it.

If the web.config has set other website rewrite, to prevent website error, contact your programmer to add for you.

<configuration>

<system.webServer>

<rewrite>

<rules>

<rule name="HTTPS force" enabled="true" stopProcessing="true">

<match url="(.*)" />

<conditions>

<add input="{HTTPS}" pattern="^OFF$" />

</conditions>

<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />

</rule>

</rules>

</rewrite>

</system.webServer>

</configuration>


If no web.config file, use test editor to create one, then add the above code.