Re: [users@httpd] lowercase to uppercase URL

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

 



On Fri, 18 Mar 2005 15:28:57 +0100, Anders Eriksson
<anders.eriksson@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Is there someway that I can configure Apache so that it will understand
> that:
> <server>/dnet/jsp/polopoly.jsp?d=1399
> <server>/Dnet/jsp/polopoly.jsp?d=1399
> <server>/dNet/jsp/polopoly.jsp?d=1399
> <server>/DNet/jsp/polopoly.jsp?d=1399
> <server>/DNET/jsp/polopoly.jsp?d=1399
> ...
> 
> are all the same.

Well, they aren't all the same, so a better idea would be to help out
your users by redirecting them to the right place.  That could be
something like

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/DNet
RewriteCond %{REQUEST_URI} ^/DNet [NC]
RewriteRule ^/[^/]+(.*) /DNet$1 [R]

The first line says to skip requests that are already in the right
case.  The second line does a case-insensitive comparison, and
therefore hits all requests that start in any case-variation of /DNet,
the third line redirects these requests to the proper case.

A similar technique could be used without the [R] to deliver the
content directly without changing the URL.

Joshua.

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