httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Covener" <cove...@gmail.com>
Subject Re: [users@httpd] RewriteRule: foo.com/directory --> foo.com/directory/
Date Mon, 04 Feb 2008 23:28:53 GMT
On Feb 4, 2008 5:20 PM, thomas Armstrong <tarmstrong@gmail.com> wrote:
> I tried adding this line
> ---------
> RewriteRule ^(.*)$ /$1/ [R=301]
> ---------

> The page isn't redirecting properly

At least protect it from running when the URL ends in a slash such as:

RewriteRule ^(.*[^/])$ /$1/ [R=301]

You're unexpected behavior is a result of doing rewrite in .htaccess,
so the rules are re-visited at a later stage despite the L flag.
-- 
Eric Covener
covener@gmail.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