make URL"s case insensitive

make URL"s case insensitive

am 20.10.2005 18:33:08 von Bill Parker

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 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: make URL"s case insensitive

am 20.10.2005 18:41:16 von Joshua Kugler

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 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: make URL"s case insensitive

am 20.10.2005 18:42:00 von Marc Perkel

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 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: make URL"s case insensitive

am 20.10.2005 18:44:12 von Joshua Slive

On 10/20/05, 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:

> 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 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: make URL"s case insensitive

am 21.10.2005 16:11:58 von Bill Parker

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"
To:
Sent: Thursday, October 20, 2005 9:44 AM
Subject: Re: [users@httpd] make URL's case insensitive


On 10/20/05, 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:

> 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 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 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: make URL"s case insensitive

am 21.10.2005 16:32:10 von Joshua Slive

On 10/21/05, 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 tha=
t
> 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 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: make URL"s case insensitive

am 21.10.2005 17:27:56 von Nick Kew

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 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: make URL"s case insensitive

am 24.10.2005 22:41:05 von pmilanese

I think it insane to code inconsistently, and rely on the server to fix it.

Oh.. Sorry... Its the unix cult. (?)



-----------------
Sent from my NYPL BlackBerry Handheld.


----- Original Message -----
From: Marc Perkel [marc@perkel.com]
Sent: 10/24/2005 04:33 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] make URL's case insensitive

I've had good luck using mod_speling. But before that I used a trick
where I used samba. The trick is to run samba, mount a share, then serve
from that share. Samba is case insensitive.

BTW - I agree - in fact I think it's insane to have a case sensitive
file system. But I'll never convince the Unix cult of that.


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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 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