1

I have some resources at these paths:

/application/myFoo
/application/myBar

always 'my' followed by a capitalized name

I'd like to redirect

/myfoo, /myFOO, /myFoo, (even /foo, /Foo if possible)

to the first one, and likewise for the second url

RewriteRule ^/my(.*) /application/my$1 [L,NC]

is my solution for the moment, it works for /myFoo, /mYFoo, but nor for /myfoo, /foo

reference: mod_rewrite - change URL case (it's a little different since I don't want to have all %{REQUEST_URI} uppercased

Community
  • 1
  • 1

1 Answers1

1

here's one possible solution

RewriteEngine   On
RewriteMap uppercase int:toupper
RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} !^/(lib|system|application)/
RewriteRule ^/?(?:my)?([a-z])(.*) /application/my${uppercase:$1}${lowercase:$2} [L,NC]