httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Whitmore" ...@spam.co.nz>
Subject Re: [users@httpd] Rewriting the Trailing Slash
Date Mon, 05 May 2003 22:35:14 GMT
It doesn't seem to work.. :-( See log..

x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (2) init rewrite
engine with requested uri /
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (3) applying pattern
'^/(.*)$' to uri '/'
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (4) RewriteCond:
input='/' pattern='!^/cgi-bin/orconbranding.pl' => matched
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (4) RewriteCond:
input='/' pattern='!^/error' => matched
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (4) RewriteCond:
input='/' pattern='!^/icons/' => matched
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (4) RewriteCond:
input='test1.orcon.net.nz' pattern='!^$' => matched
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (5) map lookup OK:
map=lowercase key=test1.orcon.net.nz -> val=test1.orcon.net.nz
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (4) RewriteCond:
input='test1.orcon.net.nz' pattern='^(.+)$' => matched
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (5) cache lookup OK:
map=vhost[txt] key=test1.orcon.net.nz -> val=/home/test1
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (4) RewriteCond:
input='/home/test1' pattern='^(/.*)$' => matched
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (2) rewrite / ->
/home/test1/
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (5) map lookup OK:
map=lowercase key=test1.orcon.net.nz -> val=test1.orcon.net.nz
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (5) setting env
variable 'VHOST' to 'test1.orcon.net.nz'
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (3) applying pattern
'^(/.+)$' to uri '/home/test1/'
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (4) RewriteCond:
input='/home/test1/' pattern='-d' => matched
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (2) rewrite
/home/test1/ -> /home/test1//
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (2) explicitly
forcing redirect with http://testbox.orcon.co.nz/home/test1//
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (1) escaping
http://testbox.orcon.co.nz/home/test1// for redirect
x.x.x.x - - [06/May/2003:18:23:32 +1200]
[testbox.orcon.co.nz/sid#80f9198][rid#81568f8/initial] (1) redirect to
http://testbox.orcon.co.nz/home/test1// [REDIRECT/302]

----- Original Message -----
From: "Garth Winter Webb" <garth@perijove.com>
To: <users@httpd.apache.org>
Sent: Tuesday, May 06, 2003 10:01 AM
Subject: Re: [users@httpd] Rewriting the Trailing Slash


> Actually you do want the slash explicitly in there so '/' isn't
> rewritten to '//':
>
> RewriteRule    ^(/.+)$           $1/  [R]
>
> On Mon, 2003-05-05 at 14:55, Garth Winter Webb wrote:
> > You could change your rewrite rule to include the slash:
> >
> > RewriteRule    ^(/.*)$           $1/  [R]
> >
> > or really just:
> >
> > RewriteRule    ^(.*)$           $1/  [R]
> >
> > On Mon, 2003-05-05 at 14:40, Craig Whitmore wrote:
> > > Can you suggest what do you to make it work?
> > >
> > > Thanks
> > > Craig
> > >
> > > ----- Original Message -----
> > > From: "Garth Winter Webb" <garth@perijove.com>
> > > To: <users@httpd.apache.org>
> > > Sent: Tuesday, May 06, 2003 9:11 AM
> > > Subject: Re: [users@httpd] Rewriting the Trailing Slash
> > >
> > >
> > > > On Mon, 2003-05-05 at 13:47, Craig Whitmore wrote:
> > > > <snip>
> > > > > If I use the
> > > > >
> > > > > RewriteCond    %{REQUEST_FILENAME}  -d
> > > > > RewriteRule    ^/(.*)$           $1/  [R]
> > > > >
> > > > > then http://www.website1.com/blah ->
> > > > > http://www.website1.com/home/username/blah/
> > > > >
> > > > > As it can't remove the /home/username/  as you can't use
RewriteBase at
> > > all.
> > > >
> > > > Are you sure this isn't happening because you rewrite to a relative
> > > > path?  Your rewrite rule matches the initial '/' but doesn't capture
it
> > > > in the parenthesis.  Thus you rewrite the absolute path '/blah' to
the
> > > > relative path 'blah/'.
> > > >
> > > > --
> > > > Garth Winter Webb <garth@perijove.com>
> > > >
> > >
> ---------------------------------------------------------------------
> > > > 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
> --
> Garth Winter Webb <garth@perijove.com>
>
> ---------------------------------------------------------------------
> 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