How to redirect HTTP to HTTPs via .htaccess file

Question: How to redirect website from HTTP to HTTPs?

Answer: To permanently redirect website from HTTP to HTTPs you need to create .htaccess file in website's folder with the following content:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

  • ssl, https, redirect
  • 12 Users Found This Useful
Was this answer helpful?

Related Articles

How can I cancel my hosting account?

In order to cancel your hosting account please follow steps below: - login to your account...