Quote:
Originally Posted by kenmore
I want to redirect http requests to https in an Apache server by modifying the http.conf file as opposed to adding a .htaccess file. All examples I have found pertain to virtual hosts. I have virtual hosts but the domain I want redirection on is not a virtual host. It is the server name. How can I redirect?
|
Where is the domain's ServerName defined in the http
d.conf if not in a virtual host container?
In the " 'Main' server configuration"?
Put the Redirect directive in the same place as the ServerName directive, and you will need to also have a https defined for that ServerName, typically in another VirtualHost container for port 443.
We have the "main" server name defined as the first VirtualHost container, because any requests to the server that don't match any other ServerName will default to the first VirtualHost.