在单独的apache虚拟主机定义之间inheritanceconfiguration参数

我有一套虚拟主机需要单独的虚拟主机定义*:80和*:443。 创build这些之后,我发现我有20-40个configuration参数,它们都是*:80和*:443共享的; 有没有一种方法来指定一次,让他们共享,而不是两次(每个VirtualHost定义一次?)

只需创build一个包含共享指令的单独configuration文件片段,并从两个虚拟主机定义中Include它。 (确保将它放置在Apache不会尝试自己包含它的位置,就像conf.d目录中的.conf文件一样)。

在虚拟主机中重写

 #By default, mod_rewrite configuration settings from the main #server context are not inherited by virtual hosts. #To make the main server settings apply to virtual hosts, #place the following directives in each <VirtualHost> section: # RewriteEngine On RewriteOptions Inherit #