httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garth Winter Webb <ga...@perijove.com>
Subject Re: [users@httpd] Rewriting the Trailing Slash
Date Mon, 05 May 2003 22:01:44 GMT
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


Mime
View raw message