htaccess rules for searches

0

I am using the following htaccess code:

<IfModule mod_rewrite.c> 
RewriteEngine on 


# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI}  !(app/view/*|web/*) [NC]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d   
RewriteRule ^(.*)$ index.php?url=$1 [PT,L] 
</IfModule>

I want the url of a search to be accepted by it:

  

http://localhost/previdencia/admin/pesquisa?search=ouvidoria

How do I make it work?

    
asked by anonymous 30.04.2015 / 13:49

1 answer

2

Use the flags [QSA, L] to use the ability to read URI requests via GET and also to rewrite. You can see more details on this question: link

Your code looks like this:

# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI}  !(app/view/*|web/*) [NC]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d   
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] 
</IfModule>
    
30.04.2015 / 14:11