Apache virtualhost SSL + non-SSL

I'm having trouble finding the right way to configure the SSL virtual host and its non-SSL copy.

I have it now:
<VirtualHost myip:80>
plenty of directives here
</VirtualHost>

and

<VirtualHost myip:443>
same directives as above
</VirtualHost>

And it works fine, but every time I edit the directives in one of the vhosts, I have to do this in the other too. Anything cleaner and more elegant?

+5
source share
1 answer

To launch a website using both the HTTP and HTTPS URLs, the only option is to run 2 separate VirtualHosts with the same DocumentRoot.

If the context of the directives allows, you can save some of the common parameters in a .htaccess file in a folder that is the parent of DocumentRoots.

+7
source

All Articles