httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonas Eckerman <>
Subject Re: [users@httpd] Redirect DirectoryIndex
Date Fri, 27 Feb 2004 11:52:31 GMT
On Sun, 22 Feb 2004 15:10:56 +0900, Batara Kesuma wrote:

> How do I redirect DirectoryIndex to another machine. I use mod_proxy and
> mod_rewrite, here is my conf:

Two notes to start with:

* Your rule does not redirect the directoryindex at all, but they do redirect *all* requests
ending in ".pl".

* Normally, the client never requests the directory index as such. The client just requests
the directory, and Apache send a directoryindex (if told to) according to it's settings.

>  DirectoryIndex
>  RewriteEngine On
>  RewriteRule ^/(.*\.pl)$$1 [P]

>  But access to is not redirected to port 8080.

AFAIK the rewriterule works on the request. The request "" does not end
in ".pl" so it doesn't match your rewriterule.

Also, the [P] doesn't redirect, it proxies wich is a completely different thing.

>  How do I fix this? Thank you.

> DirectoryIndex

Of the top of my head and completely untested:

This ought to redirect all requests for directories to the same directory on the other server:
RewriteRule ^(.*/)$$1 [R]

This ought to redirect the requests for directories to for that directory on the other
RewriteRule ^(.*/)$$ [R]


Jonas Eckerman,

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message