The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Newbie alert! Can Apache ignore case of directory?

Discussion in 'EasyApache' started by sneader, Nov 23, 2003.

  1. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    On my previous web host (running Zeus on Sun) the case of the directory name did not matter. So, http://www.xyz.com/MyName was the same as http://www.xyz.com/myname. Is this possible with Apache on RedHat 9?

    I have customers that I have converted from their previous Windows host over to my box, that have promoted their directories with some capitilization. Now all these links are coming in and I see them in the error log. The file names are mostly correct, but the directory names sometimes have case changes.

    Is there a setting on Apache to allow this, like I can do with Zeus?

    Thanks!

    - Scott
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    The problem is, windows is not case sensative, but linux/unix is.

    I had someone come from a windows server also and had to help them get everything working correctly. It woul dbe nice if it could be made case insensative, but I doubt it's possible.
     
  3. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Hi Squirrel. Thank for taking time to write back. I do understand that Windows is not case sensitive and that *nix is. But I seemed to recall that the Zeus web server software could do this type of translation, and thought Apache could... but I might be wrong on that. I still have an account on the Sun Solaris box running Zeus, lemme goof with it some more and see if I'm even right about that.
    - Scott
     
    #3 sneader, Nov 23, 2003
    Last edited: Nov 23, 2003
  4. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Looks like Apache maybe could get configured to help with this problem... reading about mod_rewrite...

    http://httpd.apache.org/docs/mod/mod_rewrite.html

    Looks complicated though.

    I'm still looking for a simple solution that would take any incoming request for say http://www.xyz.com/THIS/that.html and redirect it to http://www.xyz.com/this/that.html

    EDIT: wow, look at all the cool things that can be done with mod_rewrite...

    http://httpd.apache.org/docs/misc/rewriteguide.html

    EDIT AGAIN: Ah Hah! And you all thought I was crazy. Fire up google and check mod_speling. I'm gonna get this working if it kills me and my server.... I'm on a mission...

    - Scott
     
    #4 sneader, Nov 24, 2003
    Last edited: Nov 24, 2003
  5. cortices

    cortices Well-Known Member

    Joined:
    Mar 10, 2003
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Dallas, TX
  6. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Yep, i discovered that about the same time as you suggested it.. thanks.

    I'm reading up on it. I'm a bit worried how this all fits in with cPanel and WHM.

    Strange that mod_speling is now a standard module, yet is not compiled by default. I suppose I'll struggle with this each time I update Apache in the future? Or maybe the next update will be 2.0.

    Searched for mod_speling on this forum and only saw one other post, someone else asking how it worked with cpanel/whm, but no replies.

    - Scott
     
  7. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    FYI, I got mod_speling running tonight and am VERY pleased.

    The only problem we have is the apache log message that says:

    Loaded DSO libexec/mod_speling.so uses plain Apache 1.3 API, this module might crash under EAPI
    ! (please recompile it with -DEAPI)

    We did then recompile it with -DEAPI, but ran a diff on the new .so and the previous .so, and they are the same. We used it anyway and restarted apache, same error. Oh well, it works! But if anyone has any hints on fixing the problem, I'd sleep better.

    mod_speling is working great though, has really cut down on my 404s and I can't see any performance hit, although this box is not that heavily trafficed.

    Some examples of wrong URLs, and what it redirects to automatically.

    The "right" url is, for this example, http://www.xyz.com/abcd

    wrong: http://www.xyz.com/ABCD
    goes to: http://www.xyz.com/abcd

    wrong: http://www.xyz.com/abcd/graphic.GIF
    goes to: http://www.xyz.com/abcd/graphic.gif
    NOTE: this works for in-line images in an html file, all automagically!

    wrong: http://www.xyz.com/ABCD/test.htm
    goes to: 404 page !!!
    NOTE: it can't fix the directory, if there is a file name listed after the directory. Anyone know of a way to change that behavior?

    EDIT! Wow, this just 'started working' on its own. URLs that had a bad directory name were giving out 404s, but now it is fixing them! I think I read somewhere that mod_speling starts keeping track of correct urls or something, and uses that to help. I don't know, all I can tell you is that it now works and I'm really really happy!!!

    wrong: http://www.xyz.com/abc
    goes to: http://www.xyz.com/abcd
    NOTE: Wow!

    wrong: http://www.xyz.com/abQd
    goes to: http://www.xyz.com/abcd
    NOTE: Wow! Fixes one letter typos. If it finds multiple close matches, it brings up a "Multiple Choices" page asking you to choose which one you want. Wow.

    wrong: http://www.xyz.com/abZ
    goes to: http://www.xyz.com/abcd
    NOTE: Wow! Fixes if you forget a letter completely.

    wrong: http://www.xyz.com/aQcX
    goes to: 404 error
    NOTE: if you are more than 1 letter off, it just 404s, which is fine.


    Anyway, I'm thrilled, and my 404's have gone way down. This domain has been around since 1995, and there are a LOT of people linking to pages on this domain, and since most of that time the domain was on Windows, there are a lot of case issues here. mod_speling rules, even if it IS spelled wrong. :)

    - Scott
     
    #7 sneader, Nov 25, 2003
    Last edited: Nov 25, 2003
Loading...
Similar Threads - Newbie alert Apache
  1. ahawad
    Replies:
    2
    Views:
    234

Share This Page