Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
1.4k views
in Q2A Core by
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 ?

Thanks.
Q2A version: 1.7.4

3 Answers

+4 votes
by

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.

 

by
Can you please share the correct htaccess to use?

Thank you.
+4 votes
by
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]
by
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.
+1 vote
by
Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>
...