I'm trying to redirect from an url to an url with parameters: from http://www.domain.com/dir1/dir2/dir3/paramid to http://www.domain.com/dir4/dir5?search=param1&task=search&id=paramid
I tried in .htaccess the following :
RewriteRule ^dir1/dir2/dir3/(.*)$ /dir4/dir5?search=param1&task=search&id=$1 [R=301,L]
But I can't get it to work.
Help appreciated.
I believe you might be looking for the
QSA
orQuery String Append
Command Flag Block.Your solution is fine, as far as syntax goes, but there may be some lower-level functionality you're missing by bypassing the QSA command flag.