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 10-27-2004, 01:37 PM   PM User | #1
jspeybro
New Coder

 
Join Date: May 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
jspeybro is an unknown quantity at this point
htaccess allow ip-range and users

Hi, I've been looking for a script for htaccess but I could only find pieces. I don't know if it can be combined.
this is what I want to accomplish:
I want to allow access from the ip-range 134.xxx.xxx.xxx and request authentication if the visitor is outside this range.

I can use this code to request authentication:
Code:
AuthName "Restricted area"
AuthType Basic
AuthUserFile /full/path/to/.htpasswd
Require valid-user
and something like this to allow the ip-range 134.xxx.xxx.xxx:
Code:
<Limit GET HEAD POST> 
order allow,deny 
allow from 134
deny from all
</LIMIT>
any body knows how I can combine this?

Johan
jspeybro is offline   Reply With Quote
Old 11-07-2004, 08:00 PM   PM User | #2
Span
Regular Coder

 
Join Date: May 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Span is an unknown quantity at this point
Never tried this, but I think you need the Satisfy directive.

Code:
Order Deny,Allow
Deny from all
Allow from 134.
AuthType Basic
AuthUserFile /full/path/to/.htpasswd
AuthName "Restricted Area"
Require valid-user
Satisfy any
This should allow users from the 134. Ip range and request authentication from other users.

For more info, see the Apache Core features:
http://httpd.apache.org/docs/mod/core.html
Span 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 04:42 AM.


Advertisement
Log in to turn off these ads.