Score:2

Apache, redirect a client instead of showing HTTP/HTTPS error

us flag

If a web admin configures an HTTPS/SSL vhost on a custom port (e.g. 4433) and a browser connects to that vhost but using HTTP (http://vhost:4433), is there any way to configure apache to rather issue a redirect to the browser, sending it to HTTPS (https://vhost:4433), instead of displaying the well-known error:

Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

user2847643 avatar
us flag
Relevant: https://serverfault.com/questions/477236/apache-insecure-request-sent-to-secure-port-want-to-redirect
Score:1
us flag

Seems like you can get the behavior you want by setting something like:

ErrorDocument 400 https://vhost:4433/

Source: Apache: insecure request sent to secure port...want to redirect

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.