homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

conditional php_value in htaccess
Help with using the same htaccess on different servers

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

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)

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)

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved