Drew
Drew

Reputation: 6872

htaccess Rewrite Rule - Allowing Capital Letters in URL

I have the following Rewrite Rule:

RewriteEngine On
RewriteRule ^brand/([0-9a-zA-Z-]+)/?$ find_by_brand.php?brand=$1
RewriteCond %{THE_REQUEST} find_by_brand\.php
RewriteRule ^find_by_brand\.php - [F]

I want it to be able to work if I go to /Michelin/ and also /michelin/

Does anyone have any idea what I could add to make that work?

Thanks!

Upvotes: 3

Views: 1898

Answers (1)

Michael Berkowski
Michael Berkowski

Reputation: 270657

Add the [NC] flag ("no case")

RewriteRule ^brand/([0-9a-zA-Z-]+)/?$ find_by_brand.php?brand=$1 [NC,L]

Upvotes: 4

Related Questions