I am using Apache as a proxy server for my web application wich is running in a Glassfish container. I configured the proxy pass and also SSL in Apache. The site can be accessed from outside with the URL https://www.my-domain.com without any problem. But I want to call the site without prefix "https://" ( www.mydomain.com. )on the browser.
If I use URL without https:// it gives me the error "cannot connected to the server " on browsers (Safari, firefox ) and using curl on command prompt it says:
Rebuilt URL to: www.my-domain.com/
Trying 2xx.xxx.xxx.xxx...
connect to 2xx.xxx.xxx.xxx port 80 failed: Connection refused
I configured virtual host according to the apache documentation to redirect any request without "https" to "https". Hier is my configuration :
<VirtualHost 2xx.xxx.xxx.xxx:80>
ServerName my-domain.com
ServerAlias www.my-domain.com
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://my-domain.com [R,L]
</VirtualHost>
Is there anything that I am missing with the configuration? Why the Apache server not redirect the request ? any help would be highly appreciated.
ps. once I call the page with https:// from outside, It can be called even with cash deleted , without prefix https://. In the VPN or in same network it works without the prefix.