HTACCESS for SSL certificate


#1

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


#3

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?


#4

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


#5

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


#6

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