limit a directory to two ips via .htaccess

Post non-phpwcms related topics here - but I don't want to see "hey check this or that other cms". Post if you have a point or worthwhile comment, don't post just to increase you post count!
Post Reply
rushclub
Posts: 915
Joined: Tue 17. Feb 2004, 18:52

limit a directory to two ips via .htaccess

Post 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
3 (!) Jahre warten reichen mir. Ich bin erst mal weg.
jscholtysik

Post 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]
rushclub
Posts: 915
Joined: Tue 17. Feb 2004, 18:52

Post 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
3 (!) Jahre warten reichen mir. Ich bin erst mal weg.
jscholtysik

Post 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
Pauli
Posts: 92
Joined: Mon 30. Aug 2004, 11:53

Post 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]
Post Reply