Block access to certain folder on a website?

Hey all,
I want to block access to certain websites, however not the full website. The content I want to block is located in a folder. So how would I go about blocking, say, http://some.server.com/folder/ but not http://some.server.com/ on OS X?

Thanks in advance!

iMac Core Duo 20" Mac OS X (10.4.8)

Posted on Mar 1, 2007 10:07 AM

Reply
13 replies

Mar 1, 2007 10:22 AM in response to Necrisque

There has to be more to this question that you've asked because the simplest answer is to move the folder out of the DocumentRoot. That way no one can access it.

However, I suspect what you really want is to restrict access to it, either to certain users, or to certain IP addresses or some such, correct?

If that's the case the specifics will vary depending on precisely which access controls you want to implement (e.g. username/password, IP address, and so on.

The official word on Apache authentication can be found at http://httpd.apache.org/docs/1.3/howto/auth.html, but it' a lenghty document. If you can be more specific about what you're trying to do I'm sure someone can post a more specific answer.

Mar 1, 2007 5:12 PM in response to Necrisque

A "machine" in this context is an entry in the Netinfo Manager application. You set the URL in Netinfo Manager to point to a nonexistent localnet IP address, in this example 0.0.0.0 When the URL is requested, the request is redirected to noplace, and the browser offers an error page.

I have used this method to block sites, but don't know if it works for subfolders in a website. I was hoping someone would tell me. I would try it on my own computer but O may need to reboot for it to work, and I try to avoid rebooting.

Mar 1, 2007 5:37 PM in response to Gnarlodious

> I have used this method to block sites, but don't know if it works for subfolders in a website

No. it wil block the entire site. This is no different from adding the hostname to /etc/hosts.

When you enter a URL, the first thing the browser does is perform a name lookup on the hostname to find the IP address of the server. Then it contacts the server and sends a GET request for the URL (the rest of the URL after the hostname).

Since the name lookup (and therefore the /etc/hosts or NetInfo-> Machines lookup) is separate and distinct from the URI, it doesn't care (or even know) what folder/path you're requesting from the site, so there's no way to selectively block content in this manner.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Block access to certain folder on a website?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.