Question

I've a rewrite rule in my htaccess to check if the last segment is a alphabetic (including accented chars).

RewriteRule ^search/tag/([A-Za-záéíóú]+)$      page.php?tag=$1 [L]
RewriteRule ^search/tag/([A-Za-zàèìòù]+)$      page.php?tag=$1 [L]

why the first one works and the second one cause an internal server error 500?

The problem seems to be the "à" char, why?

Was it helpful?

Solution

Make sure to use B flag with quotes in regex to fix 500 error:

RewriteRule "^search/tag/([A-Za-záéíóú]+)$" page.php?tag=$1 [L,B]

RewriteRule "^search/tag/([A-Za-zàèìòù]+)$" page.php?tag=$1 [L,B]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top