httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toni Maatta <t...@borgship.net>
Subject Re: [users@httpd] rewrite problem
Date Mon, 03 Feb 2003 11:11:52 GMT
Hi,

It's not that easy.. :) 

What I want, is that if url ends with / apache should check if the index
file is .php or .cgi or something and if that match, it should redirect
it. REQUEST_URI doesn't tell this information, so I don't know if it
is possible at all .. 

On Mon, Feb 03, 2003 at 06:13:03AM -0500, Jurgen wrote:
> Hi,
> 
> if you want to rewrite something ending in .php to the cgi server it should look like
this:
> 
> RewriteCond %{REQUEST_URI} \.php$
> RewriteRule  ^(.*)          http://cgi-server$1 [R]
> 
> Jurgen
> 
> 
> On Mon, 3 Feb 2003 18:47:15 +0800
> "Paul Muad`dib" <uzul_2000@gmx.net> wrote:
> 
> > Cause you look for the request of /user/ and not /user/index.php
> > 
> > So you need to the condition to find an empty document /user/ to rewrite to
> > a index.php for example so someth like that
> > 
> > RewriteCond %{REQUEST_URI}
> > RewriteRule  ^*                http://cgi-server/index.php (or whatever) [R]
> > 
> > 
> > 
> > ----- Original Message -----
> > From: "Toni Maatta" <toni@borgship.net>
> > To: <users@httpd.apache.org>
> > Sent: Monday, February 03, 2003 6:34 PM
> > Subject: Re: [users@httpd] rewrite problem
> > 
> > 
> > > > Also you should have a look for the environment variables such as
> > REQUEST_URI
> > >
> > > here's what happen, when I use REQUEST_URI:
> > >
> > > this is just a test, but you'll see what happens.
> > > httpd.conf:
> > > RewriteCond %{REQUEST_URI}     .php
> > > RewriteRule  ^.*$                ${REQUEST_URI} [R]
> > >
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80bca2c/initial] (2) init rewrite
> > > engine with requested uri /user/
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80bca2c/initial] (3) applying pattern
> > > '^.*$' to uri '/user/'
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80bca2c/initial] (4) RewriteCond:
> > > input='/user/' pattern='.php' => not-matched
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80bca2c/initial] (1) pass through
> > > /user/
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80c0e44/subreq] (2) init rewrite
> > > engine with requested uri /user/index.html
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80c0e44/subreq] (1) pass through
> > > /user/index.html
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80c0e44/subreq] (2) init rewrite
> > > engine with requested uri /user/index.htm
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80c0e44/subreq] (1) pass through
> > > /user/index.htm
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80c0e44/subreq] (2) init rewrite
> > > engine with requested uri /user/index.shtml
> > > x.x.x.x - - [03/Feb/2003:11:33:32 +0200]
> > > [www.company.com/sid#809eb6c][rid#80c0e44/subreq] (1) pass through
> > > /user/index.shtml
> > >
> > > -- toni
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > >
> > 
> > 
> > ---------------------------------------------------------------------
> > 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
> 
> ---------------------------------------------------------------------
> 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
> 

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