Mohit Thareja
Mohit Thareja

Reputation: 11

Wants to redirect Drupal Website from http to https

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

Answers (1)

user3575353
user3575353

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

Related Questions