title: Customize Apache error message "You're speaking plain HTTP to an SSL-enabled server port."
body: <p>I have an Apache running at port 8080. Recently only http, but now only https. Is there a way to edit (customize) the error message that Apache sends when I accidentally access <a href="http://www.example.com:8080" rel="nofollow">http://www.example.com:8080</a> instead of the https:// version?</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;400 Bad Request&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Bad Request&lt;/h1&gt;
  &lt;p&gt;Your browser sent a request that this server could not understand.&lt;br /&gt;
  Reason: You're speaking plain HTTP to an SSL-enabled server port.&lt;br /&gt;
  Instead use the HTTPS scheme to access this URL, please.&lt;br /&gt;
  &lt;blockquote&gt;Hint: &lt;a href="https://www.example.com:8080/"&gt;&lt;b&gt;https://www.example.com:8080/&lt;/b&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;/p&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Well, then I could create an automatic redirection...</p>
  
  <p>Any acceptable solution must work with only one port (8080)!</p>