Re: mod_rewrite question - How to avoid Apache's 301 redirect to add trailing slash?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 27, 2008 at 2:40 AM, chengas123 <benjamin.j.mccann@xxxxxxxxx> 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@xxxxxxxxx

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux