CheckCase url case senstivity

Discussion in 'Apache Migration/Compatibility' started by Aakarshan29, Feb 7, 2012.

  1. Aakarshan29

    Aakarshan29 New Member

    My webhost is using litespeed and I am facing a problem which makes my script unstable when url's case is changed. Is there an solution to it so that litespeed check the url case and redirect to available directory like CheckCaseOnly string in Apache ?
  2. NiteWave

    NiteWave Administrator

    for particular URL, you can do it in .htaccess:

    RewriteRule aBc.html abc.html [NC]

    [NC] mean "no case"

    so ABC.html, AbC.html etc all accessible.

    RewriteRule aBc.html abc.html [NC,R]

    all redirect to abc.html, to let user know the correct case.
  3. Aakarshan29

    Aakarshan29 New Member

    What if I want to make litespeed check for the case url by itself and display the appropriate page ? I want it to be default for whole of the website as CheckCaseOnly in APACHE does.
  4. webizen

    webizen Well-Known Member

    here is a possible workaround:

    define RewriteMap in httpd.conf like this:
    RewriteMap lowercase int:tolower

    put the rule in httpd.conf:
    RewriteRule ^/(.*)$ /${lowercase:$1} [L]

    or in .htaccess
    RewriteRule ^(.*)$ /${lowercase:$1} [L]

Share This Page