Open Tech Support
Open Tech Support Archives
Back to HomeCommunityReviewsGuidesDownloadsTech LinksMarketplaceContact Us
 »  SITE NAVIGATION
»  OTS Home
»  OTS Forums
»  OTS Archives

»  About our site
»  Search our site
»  Support our site

»  What is this site?
»  Who are we?
 
 
 »  ADVERTISMENT
 
  Pages: 1

setting up .htaccess for both IP and user/pass verification

(Click here to view the original thread with full colors/images)


Posted by: Random

I would like to set up a website to be accesible from a number of IP numbers and ranges, and if someone attempts to access if from elsewhere, to prompt for a userid and password.

It seems that it is quite simple to set up .htaccess to do IP or user/pass authentication, but I can't find any documentation on combining the two functions.



Posted by: Canis Lupus

Hmmm, I haven't tried doing this type of setup for .htaccess before. When I get back from work, I'll try to look over my web dev links - it's got lots of .htaccess references, then I'll post back http://www.opentechsupport.net/forums/smile.gif

------------------
Those who expect nothing will never be disappointed...



Posted by: Canis Lupus

Hmmm, seems my references didn't really have much answers on how this can be done either.

But check the links below:

http://webmaster.indiana.edu/security_info/index.shtml
http://hoohoo.ncsa.uiuc.edu/docs/tutorials/user.html

I'm guessing this may take a combination of .htaccess and server side scripting (like perl or vbasic) to adjust it to your desired setting, i.e. .htaccess can take care of authenticating users from a specified IP/domain server, and server side scripting can try and authenticate the rest.

Don't really know yet how server-side scripting part can be done, coz as I said I have never tried this before. But I'll read up and see if I can find out for you.

And stick around, maybe some other people actually know a better answer http://www.opentechsupport.net/forums/smile.gif

------------------
Those who expect nothing will never be disappointed...



Posted by: Scav

I don't http://www.opentechsupport.net/forums/biggrin.gif



Posted by: Scav

what is that anyway? backend C++ or something whacky?



Posted by: Random

Thanx for your help .... found the answer. In case anybody else ever needs it:

AuthUserFile full-path-to-.htpasswd
AuthName "name of author"
AuthType Basic

satisfy any // this is the magic line
order deny,allow
deny from all
allow from <IP range>
allow from <another IP range>
require valid-user
<limit GET>
require valid-user
</limit>



Posted by: DemonBob

Sorry I am not skilled in this area either. But it seems possible to do this......


------------------
"Memories never fade, Nor does the pain with them. It only lessens with time. The only thing that we as humans can do to survive is to look forward in life."

- DemonBob the original Malo hombre
System Overload



Posted by: Canis Lupus

Thanks Random ... I probably won't have a use for this .htaccess scheme, but it's always nice to have the answer in case I do need it http://www.opentechsupport.net/forums/smile.gif

------------------
Those who expect nothing will never be disappointed...



 
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.