httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonas Eckerman <jonas_li...@frukt.org>
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 home.pl
>  RewriteEngine On
>  RewriteRule ^/(.*\.pl)$ http://domain.com:8080/$1 [P]

>  But access to http://domain.com/ is not redirected to port 8080.

AFAIK the rewriterule works on the request. The request "http://domain.com/" 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 home.pl

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 ^(.*/)$ http://domain.com:8080$1 [R]

This ought to redirect the requests for directories to home.pl for that directory on the other
server
RewriteRule ^(.*/)$ http://domain.com:8080$1home.pl [R]

Regards
/Jonas

-- 
Jonas Eckerman, jonas_lists@frukt.org
http://www.fsdb.org/


---------------------------------------------------------------------
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