I have an apache configuration with three virtualhost entries. Each entry is bound to a different port so that we can provide a different SSL certificate based on the port. Our load balancer is transparently redirecting requests to certain domain names to specific ports on the web sever.
The problem that I have is that I have a very long list of fairly complicated RewriteConds and RewriteRules that have to be the same for all three hosts. The only difference between the three entries should be the ServerName
, SSLCertificateFile
, and SSLCertificateKeyFile
entries.
Currently I have the RewriteRules replicated in each VirtualHost entry, but that makes it difficult to update the rules and make sure they are the same across the various entries.
So my question is, is there a way that I can put the RewriteRules in a single location but that will cause them to be applied to all three VirtualHost entries?
As a side note, I'm also using the same rules in a separate non-SSL configuration file.
I believe you could put the shared rules into a file and use the
Include
directive to included them each place they are needed.here are the docs for the Include directive