deny access to a specific web page

tlchost

Verified User
Joined
Apr 4, 2007
Messages
320
I'm trying to deny access to a specific web page from a specific ip address.
I believe the correct syntax in the .htpasswd file would be:
deny from 123.123.123.123

what else is in the .htpasswd file? Do I place it in /domains/sitename/public_html/ ?
Must be the advanced age here, but the various articles don't seem to explain it to me.

thanks
 
It's not .htpasswd but .htaccess. ;)

Place it in the directory where the restrictaged page is, like this:
Code:
<Files filename.html>
        Order deny,allow
        Deny from 123.123.123.123
</Files>

If you are using Apache 2.4 instead of 2.2 then the code will work but will be obsolete in some time.

Also remember that if the user is visiting from another place (from a friend) or via a VPN or a Proxy, he will still be able to see that page, because in that case he has a different ip address.
 
thanks so much....
seems the creep is using several ip, so would 123.123.123.* or 123.123.*.* work?
 
In that case it's just:
123.123.
no need for the stars. However like I said, he can always visit via the other ways I mentioned.
 
Back
Top