Hi all,
is it possible to rewrite the following URL:
http://dev.aurora.com/problem/getproblems/fieldset/2?search=false&rows=20&page=1
to
http://dev.aurora.com/problem/getproblems/fieldset/2/search/false/rows/20/page/1
Thanx in advance
Hi all,
is it possible to rewrite the following URL:
http://dev.aurora.com/problem/getproblems/fieldset/2?search=false&rows=20&page=1
to
http://dev.aurora.com/problem/getproblems/fieldset/2/search/false/rows/20/page/1
Thanx in advance
Try these rules in the .htaccess file in your document root directory:
RewriteRule ^problem/getproblems/fieldset/2/([^/]+)/([^/]+)/(.+)$ /problem/getproblems/fieldset/2/$3?$1=$2 [N,QSA]
RewriteRule ^problem/getproblems/fieldset/2/([^/]+)/([^/]+)$ problem/getproblems/fieldset/2?$1=$2 [L,QSA]
The first rule is for the recursion and the second rule ends the recursion.
Certainly; something like
^(.*)\?(search)=(.+)&(rows)=(.+)&(page)=(.+)$ $1/$2/$3/$4/$5/$6/$7
will work, but no matter whose answer you follow, you'll always need to tweak it to your situation, so you need to understand how it works.
http://httpd.apache.org/docs/2.2/rewrite/rewrite_intro.html#regex, http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html and something like http://civilolydnad.se/projects/rewriterule/ will get you a long way.