You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joshua Slive <jo...@slive.ca> on 2003/10/14 19:41:30 UTC

Re: [users@httpd] FancyIndexing for Internal use only

On Tue, 14 Oct 2003, Aaron Donovan wrote:

> I'm trying to figure out how to turn of Indexes for external clients by
> still allow them for internal users.  My preferred method is via ip, but
> domain name is also an option.  Is this possible?

Possible, but not necessarily easy.

I would try something like this:

1. Create a symlink to your document root, so that both
/usr/local/apache2/htdocs
and
/usr/local/apache2/htdocs-internal
point to the same place

2. Use the mod_rewrite to choose the docroot

RewriteEngine On
RewriteCond %{REMOTE_ADDR} regex-matching-ip-range
RewriteRule (.*) /usr/local/apach2/htdocs-internal$1

3. Set the options differently on the two directories.

<Directory /usr/local/apache2/htdocs>
Options None
</Directory>

<Directory /usr/local/apache2/htdocs-internal>
Options Indexes
</Directory>

I'm sure there are other ways to do this, but that is what comes to mind.
Note that it will only work for directories under the document root, but
you could handle other directories similarly if you want.

Joshua.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org