My .htaccess file changes (for example) example.com/brands/beams/... to example.com/php/mvc.php?htTargUrl=brands/beams/... with QSA rule.
Here's the rule:
RewriteRule ^(.+)$ php/mvc.php?htTargUrl=$1 [QSA,L,B,BNP,NC] And I need to remove htTargUrl parameter from original URL. For example: example.com/brands/beams/?htTargUrl=beams&par2=val to example.com/brands/beams/?par2=val.
I've tried many rules to do this, but none worked with the query string. If I use
RewriteCond %{QUERY_STRING} ^(.*)&?htTargUrl=[^&]+&?(.*)$ [NC] RewriteRule ^/?(.*)$ /$1?%1%2 [R=301,L] then the parameter removes not only from the original link and URL becomes example.com/php/mvc.php.
How can I do this?