apache - mod rewrite urls for search page parameters -
i rewriting search page variables with:
rewriterule ^search/([^/]*)/([^/]*)$ /search.php?search=$1&cat=$2 [l]
which works if go /search/test/members
however if on home page , use search box, url shows as:
/search?search=test&cat=members
how rewrite url when user uses search form url shows as:
/search/test/members
add these rules:
rewritecond %{the_request} \ /+search\.php\?search=([^&]+)&cat=([^&\ ]+) rewriterule ^ /search/%1/%2? [l,r]
in order redirect browser new url. cleaner url requested , rule have internally rewrite back it's supposed be.
Comments
Post a Comment