Bart
Bart

Reputation: 171

Apache mod_speling case insensitive URLs issue

I want to have case insensitive URLs using Apache's mod_speling module, but this is producing unwanted lists of "multiple options" whilst the Apache documention says

When set, this directive limits the action of the spelling correction to lower/upper case changes. Other potential corrections are not performed.

I'm testing this on an Apache 2.2.16 Unix fresh install but I'm still running into exact the same problems as submitted in 2008.

It's unexpected (and not wanted) behaviour when Apache lists a few "multiple choices" (status code 300) when the checkCaseOnly directive is on!

I have this in my httpd.conf:

CheckSpelling on
CheckCaseOnly on

First directive to use the mod_speling, second directive to limit only to case corrections

What am I doing wrong?

Upvotes: 17

Views: 26713

Answers (5)

fijiaaron
fijiaaron

Reputation: 5185

To enable mod_speling (either by Location or VirtualHost) use the directive:

CheckSpelling On

If all you want is case insensitivity use:

CheckCaseOnly On

You also need to have RewriteEngine enabled:

RewriteEngine On

Upvotes: 10

Sandra
Sandra

Reputation: 13

After reading user1647075's answer about this being a known Apache bug that's unlikely to be fixed, I decided my best option was to hide the "multiple options" page from the user by updating my Apache config to show the 404 error page for 300 status codes:

ErrorDocument 300 /404.htm

Of course, you can also create a custom error page instead of reusing the 404 error page.

Hope this workaround helps.

Upvotes: 1

user1647075
user1647075

Reputation: 131

TLDR: CheckCaseOnly is broken due to a bug that has remained unfixed for over six years as of 10/2014.

I know this is an old question, but I just ran into the same issue. This update is to help others with the same issue.

The current answers to this question are incorrect, as the OP is using mod_speling correctly, but there is a bug.

https://issues.apache.org/bugzilla/show_bug.cgi?id=44221

The underlying issue is that the apache people are in disagreement over fixing this behavior because it changes the rest of the module. This has remained unfixed for something like 6 years.

Upvotes: 10

icedwater
icedwater

Reputation: 4887

On Ubuntu 12.04 LTS using Apache 2.2, I did the following:

  1. Create speling.conf in ${APACHE}/mods-available to provide the config options.

    <IfModule mod_speling.c>
        CheckSpelling On
        CheckCaseOnly On
    </IfModule>
    
  2. Link speling.conf and speling.load into the enabled modules directory ${APACHE}/mods-enabled:

    # cd ../mods-enabled
    # ln -s ../mods-available/speling.conf speling.conf
    # ln -s ../mods-available/speling.load speling.load
    
  3. Restart the server.

    # service restart apache2
    

Upvotes: 8

Bracke
Bracke

Reputation: 122

Do you really want case insensitive URL?
Why not just force lowercase urls, like this?

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

Have a look at http://www.issociate.de/board/post/265865/make_URL

Upvotes: 0

Related Questions