Reputation: 11
I have installed the secure certificate on my website.Both versions are running, I want website automatically redirects to https. The website is created in Drupal.
Upvotes: 0
Views: 42
Reputation: 397
Add the following code to .htaccess
RewriteEngine on
# Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Upvotes: 1