I have the following conf files:
file1:
NameVirtualHost 123.45.67.890:80
<VirtualHost 123.45.67.890:80>
ServerName example.com
RedirectPermanent / https://example.com/
# RewriteEngine On
# RewriteCond %{SERVER_PORT} !^443$
# RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
# SSLRequireSSL
# Redirect permanent /secure https://example.com/
# Redirect / https://example.com/
</VirtualHost>
As you can see from the commented out lines, I have tried several approaches.
file2:
NameVirtualHost 123.45.67.890:443
<VirtualHost 123.45.67.890:443>
DocumentRoot "/opt/www/example-docroot"
ServerName example.com
DirectoryIndex index.html
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/httpd/conf.d/ssl/example.com/csr.example.2011.pem.blade
SSLCertificateKeyFile /etc/httpd/conf.d/ssl/example.com/nokey.example.2011.pem
SSLCACertificateFile /etc/httpd/conf.d/ssl/example.com/CA.blade.2011.csr
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/etc/httpd/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
Some thing removed for simplicity, names changed to protect the innocent.
I update these files on the server /etc/httpd/vhosts
then run
apachectl restart
Which does give me these warnings:
[warn] NameVirtualHost 123.45.67.890:80 has no VirtualHosts
[warn] NameVirtualHost 123.45.67.890:80 has no VirtualHosts
We have numerous vhosts running from this server. The above configs seem to be aligned, so I don't think these warnings are applying here. Maybe wrong.
Updating the default 80 (http) page in my browser, always shows the default http page.
Any suggestions, on how to get the redirect to work?