Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
3.6k views
in Q2A Core by

I have a q2a site in subdomain like http://subdomain.example.com.

I have ssl certificate enabled. How can I redirect links to https://subdomain.example.com  using .htaccess?

Thanks

Q2A version: 1.8

1 Answer

0 votes
by
Try htaccess code-

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Reference :
https://stackoverflow.com/a/27029144/4558437
by
Thank you for your answer.
So the .htaccess file https://github.com/q2a/question2answer/blob/dev/.htaccess should be like:

Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#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>

?
...