Conditional AddHandler Directive

Posted by Itai on Pro Webmasters See other posts from Pro Webmasters or by Itai
Published on 2011-11-30T23:33:19Z Indexed on 2011/12/01 2:21 UTC
Read the original article Hit count: 411

Filed under:
|
|

Is it possible to conditionally call AddHandler in the .htaccess under Apache (2.x)?

My present situation requires that a certain AddHandler is needed by one production server but that one breaks the development server. This requires to have 2 versions of .htaccess which is pain. So, instead I would like to wrap one AddHandler within a conditional. Something of this sort:

IF IP=='1.2.3.4' THEN
AddHandler type/foo .ext
ENDIF

The problem is new but out of my control for now. I know this is far from ideal and the servers used to match 100% as they should but temporarily they cannot.

© Pro Webmasters or respective owner

Related posts about apache

Related posts about htaccess