<VirtualHost *:82>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/cert.pem
DocumentRoot "/var/www/site"
<Directory "/var/www/site">
allow from all
Options -Indexes
</Directory>
</VirtualHost>
This is my virtual host config. Its working ssl on port 82.
My problem is, when i try to get this page with http its return error page like:
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://localhost:82/
So, i just want to redirect http to https on port 82. I try to add :
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
but its not working since it require http first.
How can i do this?
Thank you.
ErrorDocument 400 https://localhost:82/– mask8 Aug 1 '12 at 22:02https://localhost:82/" – Cem Aug 1 '12 at 22:08ErrorDocument 400 /redirect.htmland you create the redirect.html that actually redirects to your SSL page by meta tag or js. In my local env, it seems to work – mask8 Aug 1 '12 at 22:19