How To Redirect To https From .htaccess?

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • John_Accuwebhosting
    Senior Member
    • Jun 2006
    • 120

    How To Redirect To https From .htaccess?

    You may want to redirect users of your website directly to SSL URL https://www.domain.com when they browse your domain without SSL (https) like http://www.domain.com or http://domain.com.

    You can do it via simply adding below rewrite rules from .htaccess file of your domain. Below is the sample code:

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

    You can do the same via below code also:

    Redirect permanent / https://www.domain.com/
    Last edited by admin; 07-29-2015, 07:47 AM.
Working...
X