RewriteRule formular cautare

Probleme, intrebari si subiecte legate de Server Apache, setari in fisier htaccess si Gazduire site-uri Web (Hosting).
ciprian2301
Mesaje:9

RewriteRule formular cautare

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.

MarPlo Mesaje:4343
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]

Subiecte similare