Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using apache. I have a demo of a webapp that usually uses https. However, for the demo, I want all traffic to be on http even if a user hits https.

I have added the following entry and it works if you go to http://, but doesn't work if you go to https://

It gives you this error:

SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)

Here is my current setup:

    DocumentRoot /var/www/

How do you redirect the https->http without encountering the SSL error. In other words, turn off ssl for https://

share|improve this question

You don’t.

If you want a redirect from https://wherever to http://wherever, then port 443 of wherever actually needs to be serving HTTPS, even if it’s just enough to present a certificate and unconditionally redirect. Doing this means that http://wherever:443 won’t work, but why on earth would anybody expect it to?

There might be a custom server somewhere which is smart enough to differentiate between SSL negotiation and an plain HTTP request and do the right thing in either case, but it’s not a standard part of Apache.

You have three options:

  • Configure the application on both 80 and 443 over HTTP and HTTPS respectively
  • Configure it on only one of these and configure the other to redirect
  • Configure it on only one of these and do without the redirects (make sure that nothing points to the other one)

(HTTP and HTTP-over-SSL are completely different protocols on the wire: you can’t expect something which hasn’t been specifically designed to talk both on the same port to be able to do that).

share|improve this answer

In this case, it is the browser that is requesting a https session (its in the URL). Without actually talking SSL on 443, you won't be able to redirect the browser to use non-SSL.

share|improve this answer

Can't you just change the VirtualHost to listen on port 80, replace https with http and call it a day?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.