Вопрос

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?

Это было полезно?

Решение

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]
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top