Pagina 1 din 1

RewriteRule formular cautare

Scris: Vin Ian 24, 2014
de ciprian2301
Buna seara,
Am creeat un formular de cautare iar in htaccess am bagat:

Cod: Selectaţi tot

RewriteRule ^search/(.*)/pg/(.*)(/)?$ search.php?page=$2&q=$1 [NC,L]
RewriteRule ^search/(.*)/sort/(.*)/pg/([0-9])$ search.php?page=$3&q=$1&sort=$2 [NC,L]
RewriteRule ^search/(.*)/sort/(.*)/?$ search.php?q=$1&sort=$2 [NC,L]
RewriteRule ^search/(.*)/sort/$ search.php?q=$1 [NC,L]
RewriteRule ^search/(.*)/(.*)/$ search.php?q=$1 [NC,L]
RewriteRule ^search/(.*)/(.*)$ search.php?q=$1 [NC,L]
RewriteRule ^search/(.*)/pg/$ search.php?q=$1 [NC,L]
RewriteRule ^search/(.*)/$ search.php?q=$1 [NC,L]
RewriteRule ^search/(.*)(/)?$ search.php?q=$1 [NC,L]
RewriteRule ^search(/)?$ search.php [NC,L]
RewriteRule cautare(/)? cautare.php [NC,L]
Am intampinat o problema cand de exemplu am :
http: //localhost/search/intel/(.*)/(.*)/~ si in htaccess am pentru aceasta linie
am

Cod: Selectaţi tot

RewriteRule ^search/(.*)/$  search.php?q=$1 [NC,L]
Vreau ca celelalte elemente dupa search/(.*)/ sa fie ignorate daca nu am specificat nimic pentru ele in htaccess.

RewriteRule formular cautare

Scris: Vin Ian 24, 2014
de MarPlo
Salut
Nu stiu daca functioneaza la ce ai tu, dar incearca, in loc de (.*) sa folosesti ([^/]*) , de exemplu:

Cod: Selectaţi tot

RewriteRule ^search/([^/]*)/$  search.php?q=$1 [NC,L]