Working on a site where the plan is to move URLs from a query string format to a number based format. Lots of URLs exist that have unescaped accented & similar UTF8 characters in them. The problem? I can’t seem to get Apache2 to properly match accented characters & do a rewrite. I am doing this all in the Apache2 config.
For example, this URL:
http://great.website.example.com/?place=cafe
Will work as expected with this Apache2 RewriteRule setting:
RewriteCond %{QUERY_STRING} ^(place|location)=cafe
RewriteRule ^/find/$ /find/1234? [L,R=301]
Now look at this URL. Note the accented é
:
http://great.website.example.com/?place=café
Why doesn’t that URL work with the following Apache2 RewriteRule setting:
RewriteCond %{QUERY_STRING} ^(place|location)=café
RewriteRule ^/find/$ /find/1234? [L,R=301]
Both of these rules should rewrite the URL to the following:
http://great.website.example.com/find/1234
But the example with the accented é
simply doesn’t work. Maybe a wildcard character would work, but I can’t seem to get that to work either.