You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Anders Eriksson <an...@morateknikutveckling.se> on 2005/03/18 15:28:57 UTC

[users@httpd] lowercase to uppercase URL

Hello!

On a Server: Apache/1.3.33 (Unix) Resin/2.1.14
there is this URL:

<server>/DNet/jsp/polopoly.jsp?d=1399

The DNet is case-sensitive.

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.

I have looked a bit on mod_rewrite but I don't really get how I should do
it...

Please help!

// Anders


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


Re: [users@httpd] lowercase to uppercase URL

Posted by Joshua Slive <js...@gmail.com>.
On Fri, 18 Mar 2005 15:28:57 +0100, Anders Eriksson
<an...@morateknikutveckling.se> 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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org