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

Correct https setup

+3 votes
asked Jul 8, 2017 in Q2A Core by polle
Can someone please share the correct steps to use https with Q2A ?

Everything is ready at a server level, the only thing missing is what to do in Q2A, what htaccess code is needed, any extra config to define ?

Q2A version: 1.7.4

2 Answers

+3 votes
answered Jul 8, 2017 by Scott

There is not much you need to do. If HTTPS is working on your server then Q2A will run just fine when loading the HTTPS URLs. You may wish to do two things:

  1. Set up redirects (either at the server level or using htaccess) to redirect http:// traffic to https://
  2. Set your preferred site URL in the General options page. This is mostly used in emails for post replies/messages. So when a user gets an email saying they have a new answer, the https:// URL will be shown.


commented Jul 8, 2017 by polle
Can you please share the correct htaccess to use?

Thank you.
+2 votes
answered Jul 12, 2017 by bluegenel
Put this at the top of your htaccess file. This is what I use on my site:

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
commented Jul 16, 2017 by polle
Thank you. It seems I have to edit hundreds of calls for style sheets, js files, plugins and so on, so I will try when I have time for this. Not soon.

Thanks again for sharing.