apache virtualhost SSL + non-SSL

apache, httpd.conf, virtualhost

Solution

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

If the directives context allows, you can keep some of the common settings in a .htaccess file in a folder that is parent to both DocumentRoots.

Problem

I'm having trouble figuring out what's the proper way to setup a SSL virtual host + a non-SSL copy of it. I have it like this 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 must do it in the other as well. Anything cleaner and more elegant?

Original source

Related problems