...
Code Block | ||||
---|---|---|---|---|
| ||||
# # Use name-based virtual hosting. # NameVirtualHost *:80 # # NOTE: NameVirtualHost cannot be used without a port specifier # (e.g. :80) if mod_ssl is being used, due to the nature of the # SSL protocol. # <VirtualHost *:80> ServerAdmin opmantek@example.com DocumentRoot "/var/www/html" ServerName servername002 RewriteEngine on RewriteCond %{HTTP_HOST} !=localhost RewriteCond %{HTTP_HOST} !=127.0.0.1 RewriteCond %{REMOTE_ADDR} !=127.0.0.1 RewriteCond %{REMOTE_ADDR} !=::1 RewriteRule (.*) http://servername002.example.org$1 </VirtualHost> <VirtualHost *:80> ServerAdmin opmantek@example.com DocumentRoot "/var/www/html" ServerName servername002.example.org </VirtualHost> |
Using VHosts to Ensure redirection from HTTP to HTTPS and the correct FQDN - (HTTPS plus SSO)
To ensure ALL users are forced to use HTTPS one redirects the connections from HTTP to HTTPS. For HTTPS or more specifically the SSL certificate to work correctly you also need guarantee users are accessing via the FQDN which matches the DN string (server name) in the SSL certificate.
...