I'm facing an error with the .htaccess file and I'm not getting resolved, it's the following:
I have the following rule:
RewriteRule ^([^\.]+)$ $1.php [NC,L]
This rule aims to ignore the .php extension of all files accessed in my directory. However, when I use this rule, the others stop working, such as these:
RewriteRule ^([^/]+).$ cidade.php?slug_cidade=$1 [NC,L]
RewriteRule ^restrito/usuarios/pagina/([^/.]+)$ restrito/usuarios.php?pagina=$1 [L,QSA]
RewriteRule ^restrito/edit/usuario/([^/.]+)$ restrito/edit/usuario.php?id=$1 [NC,L]
When I use the rule to ignore extensions, all files: cidade.php
, restrito/usuarios.php
, and restrito/edit/usuario.php
when accessed show Error 404
, when I remove the rule to ignore extensions, they go to work normally, the way I would like it.
Any way to solve this problem?