Case Insensitive URLs with mod_rewrite

Posted by Paul Tarjan on Stack Overflow See other posts from Stack Overflow or by Paul Tarjan
Published on 2010-01-04T08:14:27Z Indexed on 2010/04/02 5:03 UTC
Read the original article Hit count: 280

Filed under:
|
|
|

I'd like for any url that doesn't hit an existing file, to do a lookup on the other possible cases and see if those files exist, and if so, 302 to them.

If that's not possible, then I'm ok with these compromises:

  • Only check the lowercase version
  • Only check the first path portion

For example http://example.com/CoOl/PaTH/CaMELcaSE should redirect to http://example.com/cool/path/camelCase (assuming the latter exists).

but of course a full solution is much more useful to me and others

© Stack Overflow or respective owner

Related posts about mod-rewrite

Related posts about apache