سؤال

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