i have been searching google for many hours but i couldn’t find any successful result for redirecting https requests to http
how can this be done? if i try any https request to my domain, i just get 404 error and the error below in apache error_log:
[Sun Apr 10 23:40:43 2011] [error] [client 78.184.171.254] Invalid method in request \x16\x03\x01
[Sun Apr 10 23:40:43 2011] [error] [client 78.184.171.254] File does not exist: /usr/local/apache/htdocs/501.shtml
and this means my server cannot handle 443 port at all i think
i have tried to put this code in httpd.conf:
<VirtualHost xxx.xxx.xxx.xxx:443>
ServerName srv.domain.com
RedirectPermanent / http://www.domain.com/
</VirtualHost>
but no success.
i also tried this code in .htaccess:
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
but no success
i may be making any silly mistake with these codes, if thats so, please warn me about it, or what do i do wrong / missing?
please help, i have been struggling with this issue for all the day
ok, i have solved this
i should have used <VirtualHost xxx.xxx.xxx.xxx:443> directive in pre_virtualhost_global.conf file
this change solved the problem BUT a new problem occured. :injured:
now visitors see an error which says “untrusted connection, click here to continue or do not enter bla bla bla…”
so, visitors should approve to be redirected from https to http
the easiest solution is to buy an ssl certificate but that solution is not free hehe
how can i redirect before that annoying trust error?
You can’t skip that error, because that error is generated before the connection hits the apache server. No apache configuration will allow you to bypass that.
One solution would be to buy an SSL certificate, then setup your redirects as 301, so all cached links etc are updated over one year, that is if you have any https links cached. If you don’t have any https links cached on google, then you don’t need to worry too much my friend.
As for your original problem (redirecting http => https), I’d covered that in my signature’s tutorial (sample code abounds) as well as moved that to the sticky threads. Have a look at both (or either).