Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

conditional php_value in htaccess

Help with using the same htaccess on different servers



8:48 am on Sep 11, 2003 (gmt 0)

10+ Year Member

Can anyone point me at resources for setting conditional php_values in .htaccess files?

The Problem:
I have a staging server (apache1.3 on win2k) and a live server (apache1.3 on linux) but I don't have access to httpd.conf on the live server.

The .htaccess in my document root specifies two php_values: include_path and error_log, which have different values on the staging and remote server.

Is it possible to set php_value conditionally so that I can use the same .htaccess file on both servers? I've looked at setenvif, but I can't work out how to apply the conditions to the php_value directive.


11:52 pm on Sep 11, 2003 (gmt 0)

10+ Year Member

I don't think you can set this conditionally from within .htaccess, but there's an easy workaround. Make an auto-prepended PHP script and set the values from there, using PHP's ini_set function.


7:30 am on Sep 12, 2003 (gmt 0)

10+ Year Member

Wow. Thanks Storyteller!
You've set me off in a completely new direction but this will do exactly what I want, as well as opening up all sorts of new horizons.

Featured Threads

Hot Threads This Week

Hot Threads This Month