Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by
Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{HTTP_HOST} ^mysite.com [NC] ---------------------> Added by me
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301,NC] --------> Added by me
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ --------------- All these are already present on the htaccess file
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]

The rule RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L] is creating the problem.

2 Answers

0 votes

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R=301]

place the above 2 lines into your .htaccess after #RewriteBase /

0 votes
RewriteCond %{HTTP_HOST} !^www.yoursite.com$ [NC]
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]