Problem with regular expression in .htaccess

1

I have the following URL:

 http://< site >/restrito/usuarios/pagina/

This page is responsible for displaying a table containing the users registered in the system, can receive numbers as a variable to indicate the page of the table, since I only show values of 20 in 20.

The regular expression that solved my problem was as follows:

RewriteRule ^restrito/usuarios/pagina/([^/.]+) restrito/usuarios.php?pagina=$1 [L]

The problem is that when I use $ to indicate that ER ends there I get Error 404, and this happens with all other Rules of my .htaccess .

Would anyone have the solution to this problem?

    
asked by anonymous 22.08.2017 / 00:09

1 answer

0

If you are trying to pass a querystring into the rewritten URL, for example:

http://< site >/restrito/usuarios/pagina/exemplo?foo=$

Then you may have to add the QSA flag

RewriteRule ^restrito/usuarios/pagina/([^/.]+) restrito/usuarios.php?pagina=$1 [L,QSA]
    
22.08.2017 / 00:27