Htaccess RewriteRule to accept special characters

Andres SK picture Andres SK · Nov 30, 2011 · Viewed 9k times · Source

My htaccess rewrite must handle these scenarios:

My current .htaccess configuration is:

RewriteRule ^dictionary/([\w\+]{2,50})$ /words.php?q=$1 [QSA,L]

It is not recognizing the special chars, e.g.: ñ, ó.

Any ideas? Thanks!

Answer

Andres SK picture Andres SK · Dec 6, 2011

Final solution

RewriteRule ^dictionary/([^/.]+)$ /words.php?q=$1 [QSA,L]