I'm trying to assemble a regular expression to rewrite a URL containing uppercase characters to the same URL but in all lowercase.
Example:
example.com/foO-BAR-bAz rewrite to example.com/foo-bar-baz
example.com/FOO-BAR-BAZ rewrite to example.com/foo-bar-baz
example.com/foo-bar-baz does not match
I tried ^\/(?=.*[A-Z]) to match a string with at least one uppercase character but it doesn't match the full string. I also know that I need to use a "capturing group" but I'm not sure how.
I would be implementing this redirect rule in an .htaccess file of an Apache server