Forum Moderators: phranque

Message Too Old, No Replies

.htaccess local & Internet user authorization

Require password for internet, but open access for local users

         

DaRichMan

12:23 pm on Sep 20, 2004 (gmt 0)

10+ Year Member



Can somebody help me with this (maybe) simple question?

I want to setup a .htaccess which will show a login for all internet user but not for the local network users (local user do not have to login).

Does somebody know the answer?

Thanks

py9jmas

12:34 pm on Sep 20, 2004 (gmt 0)

DaRichMan

1:08 pm on Sep 20, 2004 (gmt 0)

10+ Year Member



Thanks for this quick answer.
My English is not that good so could you or someone else give me an example?

jdMorgan

3:22 pm on Sep 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



DaRichMan,

Welcome to WebmasterWorld!

Something like this should work. You will have to adjust the authorization (password) file path and the allowed IP addresses. Add more "Allow from" lines at the end with your local addresses as needed.


AuthType Basic
AuthName "Please Log in"
AuthUserFile /httpd/secure/.htpasswd
Satisfy any
Require valid-user
Order Deny,Allow
Deny from all
Allow from 192.168.0.
Allow from 127.0.0.1

See Apache mod_access [httpd.apache.org], mod_auth [httpd.apache.org], Satisfy [httpd.apache.org], and Require [httpd.apache.org] documentation for more information.

Jim

DaRichMan

6:06 am on Sep 21, 2004 (gmt 0)

10+ Year Member



1000x Thanks ;-)