php - Rewrite condition is not working -


how rewrite url search page in opencart like

http://ip/opencart/index.php?route=product/search&filter_name=24 

but need display like

http://localhost/opencart/product/search/42 

orelse in formate userfreindly.i have tried like

rewriteengine on rewritebase /opencart rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !.*\.(ico|gif|jpg|jpeg|png|js|css) rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa]  rewritebase /opencart  rewriterule ^search$ index.php?route=product/search  [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !^/search$ rewriterule ^([^?]*) index.php?route=$1 [l,qsa] 

how this:

rewritebase / rewriterule ^opencart/([^/]*)/([^/]*)/([^/]*)$ /opencart/index.php?route=$1/$2&filter_name=$3 [l] 

please note slash in route parameter complicates things.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -