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] mod_rewrite question - How to avoid Apache's 301 redirect to add trailing slash?
Date Wed, 27 Feb 2008 17:46:45 GMT
On Wed, Feb 27, 2008 at 2:40 AM, chengas123 <benjamin.j.mccann@gmail.com> wrote:

>  However, I still have one bug left in this implementation, which shows up
>  when I request a directory without a trailing slash.  For example,
>  lumidant.com/contact becomes lumidant.com/lumidant/contact/ because Apache
>  does a 301 redirect to the actual file path to add the trailing slash.

http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryslash
controls apache sending the redirect.

Without disabling it, I think you can test via mod_rewrite if the
requested resource is a directory under the other path, and perform
the redirect yourself (without adding the intermediate dir).  I didn't
fully understand your requirement, though.

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