Pergunta

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?

Foi útil?

Solução

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]
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top