1
I have the following URL:
http://< site >/restrito/usuarios/pagina/
This page is responsible for displaying a table containing users registered in the system, can receive as variable numbers to indicate the table page, since I show only values of 20 in 20.
The regular expression that solved my problem was the following:
RewriteRule ^restrito/usuarios/pagina/([^/.]+) restrito/usuarios.php?pagina=$1 [L]
The problem is that when I use $
to indicate that the ER
ends there I get Error 404, and it happens with all the other rules of my .htaccess
.
Someone would have the solution to this problem?
Utilizes
$
where? In the URL or regex?– Guilherme Nascimento
in regex itself, the url should look like this "http://< site >/restrict/usuarios/pagina/10" if the page is 10, for example, in fact only draws my attention because for the little I know of regular expression, to end the ER uses $ and always when I make use of it, get error 404
– Wendel Souto
I still can’t understand, you mean the problem occurs when you do this
RewriteRule ^restrito/usuarios/pagina/([^/.]+)$
?– Guilherme Nascimento
Exactly that @Guilhermenascimento
– Wendel Souto
I’ll test here and as soon as I can edit the answer ;)
– Guilherme Nascimento
Quiet, if you want I can copy the whole file . htaccess here, as well as explain how the directory of the site
– Wendel Souto
Copy it whole here please, it must be conflict with another rule
– Guilherme Nascimento
<Ifmodule mod_rewrite. c> Rewriteengine On Rewritecond %{REQUEST_FILENAME} ! -f Rewritecond %{REQUEST_FILENAME} ! -d Rewriterule ([ .]+)$ $1.php [NC,L] Rewriterule restrito/ver/usuario/([ /.]+) restrito/ver/usuario.php? id=$1 [NC,L] Rewriterule restrito/usuarios/pagina/([ /.]+) restrito/usuarios.php? pagina=$1 [L] Rewriterule restrito/Edit/usuario/([ /.]+) restricted/Edit/user.php? id=$1 [NC,L] </Ifmodule> - The first Rule is so I can ignore the . php of the files
– Wendel Souto