I have Apache/2.0.59, mod_ssl/2.0.59, OpenSSL/0.9.8d with HTTP running on port 8000 and SSL running at port 9000.
Right now, I have mod_rewrite set up such that http://hostname:8000/ redirects to https://hostname:9000/ just fine.
However, if I do http://hostname:9000/, I will get a 400 Bad Request page:
---
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.
Hint: https://hostname:9000/
---
It looks like this page will only appear if I use HTTP and explicitly specify the SSL port number, which I have to when I'm using port 9000. For example, on my other test server, http://hostname/ will redirect to https://hostname/ just fine, but http://hostname:443/ will give me the above error.
Relevant httpd.conf lines:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R=301]
So how can I make this redirect work? Thanks.
Right now, I have mod_rewrite set up such that http://hostname:8000/ redirects to https://hostname:9000/ just fine.
However, if I do http://hostname:9000/, I will get a 400 Bad Request page:
---
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.
Hint: https://hostname:9000/
---
It looks like this page will only appear if I use HTTP and explicitly specify the SSL port number, which I have to when I'm using port 9000. For example, on my other test server, http://hostname/ will redirect to https://hostname/ just fine, but http://hostname:443/ will give me the above error.
Relevant httpd.conf lines:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R=301]
So how can I make this redirect work? Thanks.
