HTACCESS for SSL certificate

I have the following in my HTACCESS file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

Now for a domainname I ordered a SSL certificate and need to add the following to the HTACCESS file:

RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

Can I just add these lines or should I rewrite the HTACCESS. If yes how should it look like? Thank you in advnce

Hey donboe,

Try this:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

Does that work?

Hi Pullo. Sorry for the late reply. Yes that works great. :+1: Thanks a lot :smile:

1 Like

A post was split to a new topic: Help with htaccess https redirect

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.