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

I need .htaccess file to force https

+3 votes
asked Apr 24 in Q2A Core by Aras Ahmed
I installed ssl certificate

I need to make the traffic force https by modifying  .htaccess 301 or 302 redirect

Please provide me suitable solution
Q2A version: 1.7.4

3 Answers

0 votes
answered Apr 24 by Hypo
You can use cloudflare pages rules
commented Apr 25 by Aras Ahmed
I did try it the website go offline
Am I have to remove the .htaccess file while enable the cloudflare redirect ?
I am using comodo SSL can I use cloudflare with it ?
+1 vote
answered May 8 by Luis74
Modify from your control panel of your hosting the necessary parameters
You do not need to change .htaccess
+1 vote
answered May 17 by bluegenel
Put this at the very top of your htaccess file: This is what I use on my website.

If you don't get 'secure' in the address field in your browser it will probably be because you need to make all url's relative and not absolute.

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]