.htaccess - Multiple rewrite rules in htaccess -


i have .htaccess file rewrites urls seo purposes

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ /display.php?page=$1 [l,nc,qsa] rewriterule ^search/([^/\.]+)/?$ search.php?what=$1&where=$2 [l,nc,qsa] 

now first rewrite rule works fine. (www.domain.com/user goes display.php?page=user) second 1 should work (www.domain.com/search/something/else must go search.php?what=something&where=else

what doing wrong here?

your second rule incorrect looking for. requesting result of 2 captures, making 1 capture.

try instead:

rewriterule ^search/([^/\.]+)/([^/\.]+)/?$ search.php?what=$1&where=$2 [l,nc,qsa] 

edit: you'll need switch rules around. first rule captures everything, , therefore discard second.

so, swap them around, , use l flag, suggested already.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -