Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

I bought SSL Certificate. How can I redirect HTTP to HTTPS ?

+3 votes
442 views
asked Apr 25, 2016 in Q2A Core by businesscata
I bought SSL Certificate. How can I redirect HTTP to HTTPS ?
Q2A version: 1.7.4
commented Mar 21, 2017 by Martu
Which answer is best?

2 Answers

+1 vote
answered Apr 26, 2016 by JasonParms

Using this .htaccess code, you can permanently redirect your website on https://www

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

</IfModule>

commented Apr 27, 2016 by businesscata
I add this code but gives an error. and not open

domain.com/index.php?qa-rewrite=113/.................
+1 vote
answered Apr 28, 2016 by Adil

In htacces find the <IfModule mod_rewrite.c>

and add this code 

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

...