Re: Apache Rewrite (mod_rewrite) cannot rewrite, if directory name is lib, var, etc, on Linux

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

 



Wow, it worked! Amazing!

The use of [PT] should be included in almost every tutorial and examples of Apache Rewrite.

Most tutorials I have read use URI, not absolute paths. They all should add [PT] to avoid such issues and to reduce time wasted on checking file system first.

Thank you! Your solution is awesome!

Best Regards,
Zhé

陈喆
Cʜᴇ́ɴ Zhé

On Thu, Mar 1, 2018 at 8:59 PM, Eric Covener <covener@xxxxxxxxx> wrote:
mod_rewrite has a design problem where it tries to guess if you're
rewriting to a URL or a local Path by looking at the first segment of
your substitution.

If it exists in the filesystem it uses it as a path.
If it doesn't, it prepends the document root.

I believe simply adding the [PT] flag will force it to always be
treated as a URL substitution.

This is why things in the file system root behave differently.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
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