I am hosting a control panel for web management on a second Apache instance that runs on port 2083. It has port 2082 for the HTTP
version of the site because it needed something to run the HTTP
version on but the port is closed. When the user connects to the site like so:
https://example.com:2083/
They see the web panel. However, when they visit the site like this:
http://example.com:2083/
They get the 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.
There is no link to click to continue. Instead of showing this error, I would like to automatically force the HTTPS
protocol on the URL so they use the secured version of the portal. Since 2083
is being used for the SSL port on this panel, it causes a conflict if they don't specify HTTPS. And using the .htaccess
file to add a redirect does not work since the port is loaded and sees the error before it loads anything else, ending there without ever reading the .htaccess
file.
I am running Apache 2.4.23 on both the main version of the site (hosted on a Windows machine) and on the control panel. As far as I am aware this is the newest available model for a win64 model machine.
Is there any way to force the HTTPS before it loads anything else?
Here is the current httpd-ssl file
Listen 2083
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"
SSLProxyCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"
SSLHonorCipherOrder on
SSLProtocol all -SSLv2 -SSLv3
SSLProxyProtocol all -SSLv2 -SSLv3
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:c:/panel/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
<VirtualHost *:2083>
SSLEngine on
SSLCertificateFile "c:/panel/conf/ssl/sslcert.crt"
SSLCertificateKeyFile "c:/panel/conf/ssl/sslcert.key"
SSLCertificateChainFile "c:/panel/conf/ssl/sslcert.ca-bundle"
ServerName https://sitename.com
ServerAlias www.example.com
DocumentRoot "c:/panel/htdocs/"
</VirtualHost>
ServerName https://sitename.com
ServerAlias www.example.com
Is this inconsistency intended, or a result of mistakes in editing?