Leap Hawk
Leap Hawk

Reputation: 661

https redirection not working for home directory

I'm currently trying to force https for may domain name. Its working for mydomain/wildcard but not for the home url that is mydomain/

I'm using this line for redirection in my .htaccess file:

    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Upvotes: 1

Views: 33

Answers (1)

Joe
Joe

Reputation: 4917

You're almost there, use this in your .htaccess:

RewriteEngine On

#Force HTTPS on everything
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

That will force HTTPs on everything

Upvotes: 1

Related Questions