RewriteRule does not work with a specific word

0

It just does not work for "event", but if I change to "evenTo" it works, eg:

Does not work

RewriteRule ^evento/([a-z,0-9,A-Z,_-]+)/([0-9]+)?$ evento.php?log=$1&id=$2

It works

RewriteRule ^evenTo/([a-z,0-9,A-Z,_-]+)/([0-9]+)?$ evento.php?log=$1&id=$2

Full .htaccess code

RewriteRule ^busca/([a-z,0-9,A-Z,_-]+)/([a-z,0-9,A-Z,_-]+)?$ buscador.php?log=$1&id=$2
RewriteRule ^busca/([a-z,0-9,A-Z,_-]+)/([a-z,0-9,A-Z,_-]+)/([0-9]+)?$ buscador.php?log=$1&id=$2&p=$3
RewriteRule ^local/([a-z,0-9,A-Z,_-]+)/([0-9]+)?$ interna.php?log=$1&id=$2
RewriteRule ^([a-z,0-9,A-Z,_-]+)?$ index.php?cid=$1
RewriteRule ^noticia/([a-z,0-9,A-Z,_-]+)/([0-9]+)?$ noticia.php?log=$1&id=$2
RewriteRule ^evento/([a-z,0-9,A-Z,_-]+)/([0-9]+)?$ evento.php?log=$1&id=$2
RewriteRule ^perfil/([0-9]+)?$ perfil.php?id=$1
RewriteRule ^cupom/([0-9]+)?$ cupom.php?id=$1
    
asked by anonymous 22.12.2014 / 18:54

1 answer

0

There is no need for these commas, and your problem is the order of the statements. Try this:

RewriteRule ^busca/([a-z0-9A-Z_-]+)/([a-z0-9A-Z_-]+)?$ buscador.php?log=$1&id=$2
RewriteRule ^busca/([a-z0-9A-Z_-]+)/([a-z0-9A-Z_-]+)/([0-9]+)?$ buscador.php?log=$1&id=$2&p=$3
RewriteRule ^local/([a-z0-9A-Z_-]+)/([0-9]+)?$ interna.php?log=$1&id=$2
RewriteRule ^noticia/([a-z0-9A-Z_-]+)/([0-9]+)?$ noticia.php?log=$1&id=$2
RewriteRule ^evento/([a-z0-9A-Z_-]+)/([0-9]+)?$ evento.php?log=$1&id=$2
RewriteRule ^perfil/([0-9]+)?$ perfil.php?id=$1
RewriteRule ^cupom/([0-9]+)?$ cupom.php?id=$1
RewriteRule ^([a-z0-9A-Z_-]+)?$ index.php?cid=$1

I put the index.php last, so that apache tests all the other rules before entering it, understood?

    
06.12.2016 / 21:07