httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] FancyIndexing for Internal use only
Date Tue, 14 Oct 2003 17:41:30 GMT

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


Mime
View raw message