You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by do...@netnevada.net on 2005/10/20 18:33:08 UTC

[users@httpd] make URL's case insensitive

Hi All,

   I run apache 2.0.5x, and was wondering if there is a way to make URL's (after
the domain portion) case insensitive in apache (all URL's), for example:

www.foobar.com/JUNKFOOD.htm (client browser)

would be processed by httpd as:

www.foobar.com/junkfood.htm (server side)

In reading the apache FAQ in 1.3, it says the following:

You can't! The reasons are: first, that, case translations for arbitrary length
URLs cannot be done via regex patterns and corresponding substitutions. One
needs a per-character pattern like the sed/Perl tr|..|..| feature. Second, just
making URLs always upper or lower case does not solve the whole problem of
case-INSENSITIVE URLs, because URLs actually have to be rewritten to the correct
case-variant for the file residing on the filesystem in order to allow Apache to
access the file. And the Unix filesystem is always case-SENSITIVE.

But there is a module named mod_speling.c in the Apache distribution. Try this
module to help correct people who use mis-cased URLs.

Barring this, can mod_speling be set to not provide a list of files that are a
'close match' providing that the exact match is not found?

Bill


---------------------------------------------------------------------
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] make URL's case insensitive

Posted by Nick Kew <ni...@webthing.com>.
On Friday 21 October 2005 15:11, Bill Parker wrote:
> Well, the goal is to simply make everything in the URL which is received by
> APACHE lower case, as case sensitivity is a(n) issue on unix/linux/etc.  In
> windows it doesn't matter, since filenames are case insensitive (hope that
> clears up the confusion)...

Apache doesn't matter here.  Neither does the underlying operating system
or filesystem.

It is HTTP, the protocol of the Web, that is case-sensitive.
Anything that tries to pretend it's not is broken.

-- 
Nick Kew

---------------------------------------------------------------------
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] make URL's case insensitive

Posted by Joshua Slive <js...@gmail.com>.
On 10/21/05, Bill Parker <do...@netnevada.net> wrote:
> Well, the goal is to simply make everything in the URL which is received by
> APACHE lower case, as case sensitivity is a(n) issue on unix/linux/etc.  In
> windows it doesn't matter, since filenames are case insensitive (hope that
> clears up the confusion)...
>

Well, you just changed your question.  Mapping to all-lowercase is
actually possible, as opposed to general case-insensitivity which is
not possible (and, in addition, not advisable, since proxy caches,
search engines, etc are all case sensitive).

Something like:

RewriteEngine On
RewriteMap lc int:tolower
RewriteRule (.*) ${lc:$1} [R]

(The [R] on the end is not strictly necessary, but is highly
recommended unless you want many variants of your URLs to propogate to
search engines and caches.)

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


Re: [users@httpd] make URL's case insensitive

Posted by Bill Parker <do...@netnevada.net>.
Well, the goal is to simply make everything in the URL which is received by
APACHE lower case, as case sensitivity is a(n) issue on unix/linux/etc.  In
windows it doesn't matter, since filenames are case insensitive (hope that
clears up the confusion)...

----- Original Message ----- 
From: "Joshua Slive" <js...@gmail.com>
To: <us...@httpd.apache.org>
Sent: Thursday, October 20, 2005 9:44 AM
Subject: Re: [users@httpd] make URL's case insensitive


On 10/20/05, dogbert@netnevada.net <do...@netnevada.net> wrote:
> Hi All,
>
>    I run apache 2.0.5x, and was wondering if there is a way to make URL's
(after
> the domain portion) case insensitive in apache (all URL's), for example:
>
> www.foobar.com/JUNKFOOD.htm (client browser)
>
> would be processed by httpd as:
>
> www.foobar.com/junkfood.htm (server side)
>
> In reading the apache FAQ in 1.3, it says the following:

> Barring this, can mod_speling be set to not provide a list of files that
are a
> 'close match' providing that the exact match is not found?

Barring what?  Your question is not very clear.  What about the answer
in the FAQ didn't you understand?  (If you are asking if this has
changed in 2.x, the answer is no.)  Regarding mod_speling, no it is
not possible to turn off the Multiple Choices page (without hacking
the source code).  You could try
ErrorDocument 300 http://example.com/404.html
but I don't know if that would work.

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




---------------------------------------------------------------------
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] make URL's case insensitive

Posted by Joshua Slive <js...@gmail.com>.
On 10/20/05, dogbert@netnevada.net <do...@netnevada.net> wrote:
> Hi All,
>
>    I run apache 2.0.5x, and was wondering if there is a way to make URL's (after
> the domain portion) case insensitive in apache (all URL's), for example:
>
> www.foobar.com/JUNKFOOD.htm (client browser)
>
> would be processed by httpd as:
>
> www.foobar.com/junkfood.htm (server side)
>
> In reading the apache FAQ in 1.3, it says the following:

> Barring this, can mod_speling be set to not provide a list of files that are a
> 'close match' providing that the exact match is not found?

Barring what?  Your question is not very clear.  What about the answer
in the FAQ didn't you understand?  (If you are asking if this has
changed in 2.x, the answer is no.)  Regarding mod_speling, no it is
not possible to turn off the Multiple Choices page (without hacking
the source code).  You could try
ErrorDocument 300 http://example.com/404.html
but I don't know if that would work.

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


Re: [users@httpd] make URL's case insensitive

Posted by Marc Perkel <ma...@perkel.com>.

dogbert@netnevada.net wrote:

>Hi All,
>
>   I run apache 2.0.5x, and was wondering if there is a way to make URL's (after
>the domain portion) case insensitive in apache (all URL's), for example:
>
>www.foobar.com/JUNKFOOD.htm (client browser)
>
>would be processed by httpd as:
>
>www.foobar.com/junkfood.htm (server side)
>
>In reading the apache FAQ in 1.3, it says the following:
>
>You can't! The reasons are: first, that, case translations for arbitrary length
>URLs cannot be done via regex patterns and corresponding substitutions. One
>needs a per-character pattern like the sed/Perl tr|..|..| feature. Second, just
>making URLs always upper or lower case does not solve the whole problem of
>case-INSENSITIVE URLs, because URLs actually have to be rewritten to the correct
>case-variant for the file residing on the filesystem in order to allow Apache to
>access the file. And the Unix filesystem is always case-SENSITIVE.
>
>But there is a module named mod_speling.c in the Apache distribution. Try this
>module to help correct people who use mis-cased URLs.
>
>Barring this, can mod_speling be set to not provide a list of files that are a
>'close match' providing that the exact match is not found?
>
>  
>
Use mod_speling


---------------------------------------------------------------------
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] make URL's case insensitive

Posted by Joshua Kugler <jo...@uaf.edu>.
On Thursday 20 October 2005 08:33, dogbert@netnevada.net wrote:
> Hi All,
>
>    I run apache 2.0.5x, and was wondering if there is a way to make URL's
> (after the domain portion) case insensitive in apache (all URL's), for
> example:
>
> www.foobar.com/JUNKFOOD.htm (client browser)
>
> would be processed by httpd as:
>
> www.foobar.com/junkfood.htm (server side)
>
> In reading the apache FAQ in 1.3, it says the following:
>
> You can't! The reasons are: first, that, case translations for arbitrary
> length URLs cannot be done via regex patterns and corresponding
> substitutions. One needs a per-character pattern like the sed/Perl
> tr|..|..| feature. Second, just making URLs always upper or lower case does
> not solve the whole problem of case-INSENSITIVE URLs, because URLs actually
> have to be rewritten to the correct case-variant for the file residing on
> the filesystem in order to allow Apache to access the file. And the Unix
> filesystem is always case-SENSITIVE.
>
> But there is a module named mod_speling.c in the Apache distribution. Try
> this module to help correct people who use mis-cased URLs.
>
> Barring this, can mod_speling be set to not provide a list of files that
> are a 'close match' providing that the exact match is not found?

What about creating a 404 cgi error document that will present the user with a 
message saying "Did you mean www.foobar.com/junkfood.htm"  That way, they 
will find the file, and be reminded about the spelling for the next time.

j----- k-----

-- 
Joshua Kugler
CDE System Administrator
http://distance.uaf.edu/

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