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

redirecting http to https without messing up qa-rewrite?

+4 votes
431 views
asked Jul 12, 2014 in Q2A Core by LaughingYoda
I trying to move my whole site over to https and have changed all links but, I'm having problems using .htaccess to redirect http to https, here's what I have in the file:
RewriteEngine On
#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]
 
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

1 Answer

–1 vote
answered Jul 16, 2016 by Varga Mark
this solution it is working :)
commented Jul 18, 2016 by Tibriz
No, its not. When you have the short link of the question, its not working like question2asnsfs.com/1798 so it tells you "redirects this url to question2asnsfs.com/index.php?qa-rewrite=1798" and 404 found error.
...