Domanda

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?

È stato utile?

Soluzione

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]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top