I have an apache module which uses the ap_hook_post_read_request hook to perform an internal redirect when certain conditions are met. I would like to restrict this handler to a single virtual host but currently it fires on all virtual hosts (there are many). The httpd.conf configuration is limited to the LoadModule directive. I've tried using SetHandler handlername in the vhost and SetHandler None in the main config but the handler is still invoked on requests to other vhosts. The module also registers the ap_register_output_filter hook but the output filter does not perform any action other than removing itself and passing control onwards.

有帮助吗?

解决方案

I created some custom config in the vhost. I look for this config in the module and return if it doesn't have the config, so this in effect allows me to restrict the module to a vhost.

其他提示

Try this:

# VirtualHost1 = localhost:80

<IfModule mod_weblogic.c>
<VirtualHost 127.0.0.1:80>
DocumentRoot "C:/test/VirtualHost1"
ServerName localhost:80
</VirtualHost>
</IfModule>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top