2

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.

Mladen B.
  • 212
  • 2
  • 7
  • Relevant: https://serverfault.com/questions/477236/apache-insecure-request-sent-to-secure-port-want-to-redirect – user2847643 Dec 04 '21 at 17:13

1 Answers1

1

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

user2847643
  • 111
  • 2