.htaccess conditional configuation multiple servers

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

.htaccess conditional configuation multiple servers

Post by Ollie Saunders »

I want to try and standardize my PHP and server configuration across multiple servers. I was hoping this could be done with a single .htaccess file something like this:

Code: Select all

php_value default_charset UTF-8
<VirtualHost ezme>
        Options +Indexes
</VirtualHost>
<VirtualHost _default_>
        Options -Indexes
</VirtualHost>
Here what I am trying to achieve is to have my development server (ezme) allow Indexes and all others (production servers) disallow it. But you can't do that because <VirtualHost> isn't valid in .htaccess. Does anybody have any other suggestions. Ideally what I'm after is
  • Apply configuration directives conditionally based on something identifiable about the server
  • A single easily, deployable configuration file
  • Something that requires the minimum of permissions. For instance I can't modify http.conf on most servers
Post Reply