Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-18-2012, 06:28 PM   PM User | #1
devinemke
Regular Coder

 
devinemke's Avatar
 
Join Date: Dec 2004
Location: NYC
Posts: 443
Thanks: 0
Thanked 12 Times in 11 Posts
devinemke is an unknown quantity at this point
Apache IfDefine conditionals in .htaccess

my dev setup: Mac OSX 10.7.4 / Apache 2.2.21 / PHP 5.3.10

i wish to add conditional logic to my .htaccess files depending on dev vs live environment. for example i want to have authentication on the live server but not on the dev server. i have in my httpd.conf...
Code:
SetEnv DEV 1
i have confirmed that this var is set by checking the output from phpinfo(). then in my .htaccess file...
Code:
<IfDefine !DEV>
AuthType Basic
AuthName "password protected"
AuthUserFile /path/to/.htpasswd
Require valid-user
</IfDefine>
but i am still prompted for password on my local dev. it appears that the DEV variable is not available to .htaccess. i do have AllowOverride All set in my httpd.conf for my doc root. any ideas? thanks.
devinemke is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:37 AM.


Advertisement
Log in to turn off these ads.