Page 1 of 1

limit a directory to two ips via .htaccess

Posted: Mon 9. May 2005, 15:18
by rushclub
can anyone tell me how to block one directory and its subdirectories for all but two ips (lets say 123.123.123.123 & 124.124.124.124) via htaccess?
thanks for help

cheers
rush

Posted: Mon 9. May 2005, 15:31
by jscholtysik
Hi rush,


try this one:
Order deny,allow

Deny from all

Allow from 123.123.123.123

Allow from 124.124.124.124
Joachim
[/quote]

Posted: Mon 9. May 2005, 15:50
by rushclub
the i get this errormessage:

Code: Select all

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, info@bla.de and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
any idea?
cheers
rush

Posted: Mon 9. May 2005, 16:03
by jscholtysik
Hi rush,

this is the info selfhtml 8.1 gave me :

http://de.selfhtml.org/servercgi/server/htaccess.htm

http://de.selfhtml.org/projekt/kontroll ... logdateien


What says your logfiles?


Joachim

Posted: Tue 10. May 2005, 08:47
by Pauli
You can block articles too for all ip's, except these 2, by putting it in the main block of your template...

[PHP]if(
(($_SERVER['REMOTE_ADDR']) != "123.123.123.123") &&
(($_SERVER['REMOTE_ADDR']) != "124.124.124.124")) {
header ("location: http://www.domain.com/index.php");
exit;}[/PHP]