I have a situation with opencart where I need to rewrite only the "route" leaving other query strings as it is. Example:
http://www.example.com/?route=module/ext/products&category_id=15&sort=newest
to
http://www.example.com/ext/products?category_id=15&sort=newest
how can I do that?
UPDATE: I have some constraints. This rewrite condition should only be applied to route=module/ecomapi/([^&]+)
. Not for other routes.
RewriteRule ^ecomapi/21/(products)/([^?]*)$ index.php?route=module/ecomapi/$1&product_id=$2 [L]
RewriteRule ^ecomapi/21/(login)/([^?]*)$ index.php?route=module/ecomapi/$1&email=$2 [L]
RewriteRule ^ecomapi/21/(users)/([^?]*)$ index.php?route=module/ecomapi/$1&id=$2 [L]
RewriteRule ^ecomapi/21/(products|navigation_drawer|banners|cart|login|devices|shops)?$ index.php?route=module/ecomapi/$1 [B,L,QSA]
route
URL param (everything aftermodule/
?) and using this in the URL-path? Is theroute
URL param always first in the query string? Is it for this single URL or do you need a general solution? Can you clarify whether you mean a "rewrite" or an "external redirect"?