Welcome to WebmasterWorld Guest from 3.227.208.153

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

mod_speling

     
3:39 am on Nov 29, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:12913
votes: 893


When I first added CheckSpelling On to my .htaccess, it worked seamlessly by delivering the correct page to close spelling errors. This was great. All of a sudden, if a user misspells one of my page names, he is taken to an Apache page called Choices which explains the confusion and offers the user a link to follow (to that same page.) That's cool too, except I really like the first method!

I've read through the Apache mod_speling [httpd.apache.org] info page, but fail to see where/if I can control this. Either my host changed things on their server config, or one of the dozens of edits I've done lately in my .htaccess is to blame. Anyone have an idea? Thanks.

4:09 am on Nov 29, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


keyplyr,

This probably depends on exactly which URL you misspell. The choices appear if the misspelt URL cannot be corrected unambiguously. From the mod_speling document:


If, after scanning the directory,

  • no matching document was found, Apache will proceed as usual and return a "document not found" error.
  • only one document is found that "almost" matches the request, then it is returned in the form of a redirection response.
  • more than one document with a close match was found, then the list of the matches is returned to the client and the client can select the correct candidate.

  • Jim
    4:18 am on Nov 29, 2003 (gmt 0)

    Senior Member from US 

    WebmasterWorld Senior Member keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

    joined:Sept 26, 2001
    posts:12913
    votes: 893


    Thanks for posting that Jim. I did read that, but my gripe is that it isn't true - LOL

    Testing with:

    h*tp://www.example.com/blah
    returned the choices page, even though there is a:
    h*tp://www.example.com/blah.html
    (pretty darn close I'd say) and no other page name even close.

    <added>
    Actually, only one choice was offered on the Choices page, so why didn't it just redirect?
    </added>

    So maybe the file type needs to be present. The mod_speling can associate page names but not make the leap to matching file types?

    6:06 am on Nov 29, 2003 (gmt 0)

    Senior Member

    WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

    joined:Mar 31, 2002
    posts:25430
    votes: 0


    Strange...

    Are you sure you don't have a subdirectory with a name close to "blah"? That's the only other thing I can think of. I've never used mod_speling myself because of the overhead and the fact that I've just never had many 'wrong URLs' requested (that didn't deserve a 404), so I don't know how well it works. But it sounds like something's got it confused.

    Jim

    6:22 am on Nov 29, 2003 (gmt 0)

    Senior Member from US 

    WebmasterWorld Senior Member keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

    joined:Sept 26, 2001
    posts:12913
    votes: 893


    By "overhead" do you mean that server time takes a noticeable hit?

    5:21 pm on Nov 29, 2003 (gmt 0)

    Senior Member

    WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

    joined:Mar 31, 2002
    posts:25430
    votes: 0


    Yes, for the case where an often-accessed resource has been linked-to with an incorrect URL, the liklihood of having many simultaneous spelling lookups goes up, and the documentation warns that this can slow things down. The important part of that note is "simulataneous lookups", though. If you don't often see multiple imultaneous misspelled requests, you don't have to worry about it -- It just put me off on the one case where I was considering it, and I went for a specific mod_rewrite redirect to solve the problem instead.

    Jim