Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to put a condition in my apache config that if a request comes from a specific IP then load a particular config file. Is this possible?


if (
Include conf/mod_security.conf
share|improve this question

You can't choose to include a configuration file within your apache configuration based on the visitor. This is because apache compiles all of the configuration data as soon as it starts. You can make adjustments like mod_rewrite rules based on the visitor's IP, or you can utilize mod_access.

Apache's "include" directive is only valid within the main configuration, or contexts. There's a bunch of documentation available on that directive.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.