Stephen Enathu
Stephen Enathu

Reputation: 23

How to make changes to this .htaccess to load my site in SSL

My .htaccess file is shown below

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Recently I have installed the SSL, so I needs to make sure that my customers connect to my website in HTTPS. So what changes I needs to make in this code to load my website in SSL

Upvotes: 2

Views: 21

Answers (1)

Amit Verma
Amit Verma

Reputation: 41219

To load your site in SSL ,you can use

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#http to https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R]
###########
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Upvotes: 1

Related Questions