1. Home
  2. Knowledge Base
  3. Website
  4. Website Tips
  5. How to redirect your website http site to https

How to redirect your website http site to https

In order to redirect your http site to https, you can enter the following code into your .htaccess file under public_html. Ensure to upload the file into the correct directory.

Redirect your http site to https:

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don’t put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

If you need assistance or have any further enquiries, feel free to contact our support team.

Click here to view this article as Oryon knowledge base video tutorial playlist.

Related Articles