How do define parameter for use in <IfDefine> in .htaccess

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How do define parameter for use in <IfDefine> in .htaccess

Postby AerixJ » 24. March 2010 20:08

Hi there.

I'm relatively ignorant about Apache, knowing just enough to get XAMPP to work -- so please pardon my awkwardness framing this question.

I'm trying to look for a way to define a parameter for use in <IfDefine> conditionals in the .htaccess files of the sites I develop.

My goal is to set different php include paths for different platforms, since I work in both Windows XP and Mac OSX. And of course, there has to be an include path for Unix, too, at the remote host for these sites.

Here's what I'm trying to get to work in an .htaccess file (www is my web folder, instead of xampp/htdocs):

Code: Select all
# Remote host include path (default):
php_value include_path .:/usr/www/users/ejs/includes
# Windows XP include path:
<IfDefine WindowsXP>
php_value include_path .;C:\www\includes
</IfDefine>
# Mac OS X include path:
<IfDefine WindowsXP>
php_value include_path .:/www/includes
</IfDefine>


I should note that the directory structure (aside from Windows and Mac drive conventions) is the same in both the PC and Mac environments. This facilitates syncing of the files (PC is a desktop machine; Mac is a laptop for working out of the office).

I was able to find the right line for defining a parameter in the apachectl file on my Mac installation of XAMPP. I added "-DMacOSX" to it and it works just right. But I can't for the life of me figure out where I would add "-DWindowsXP". Nothing I've tried has worked.

Any ideas on how to pass a parameter definition when starting Apache on Windows?
AerixJ
 
Posts: 3
Joined: 22. March 2010 21:58

Re: How do define parameter for use in <IfDefine> in .htaccess

Postby WilliL » 24. March 2010 20:38

an idea - in php there are (on XP):
$_SERVER['SERVER_SOFTWARE']: Apache/2.2.14 (Win32) DAV/2 mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
$_SERVER['HTTP_USER_AGENT']: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 (.NET CLR 3.5.30729)

perhaps there are similar variables to use in .htaccess (not tried)
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1


Return to XAMPP for Windows

Who is online

Users browsing this forum: Onion and 135 guests