I have tried many answers but none of them seems to work.
WHAT I WANT?
1). I want to redirect this(if it contains the parameters from & to and both of them are not empty):
https://arc.abc.com/mconvertar.php?from=gbp&to=jpy
to
https://arc.abc.com/gbpjpy/
As you can see, we combined the values of from & to
2). And this(if it contains the parameter x along with from & to):
https://arc.abc.com/mconvertar.php?from=gbp&to=jpy&x=13
to
https://arc.abc.com/gbpjpy/x=13
As you can see the 13 is the same as the above url.
3). And if x is empty then:
https://arc.abc.com/mconvertar.php?from=gbp&to=jpy&x=
to
https://arc.abc.com/gbpjpy/x=1
As you can see we set the x value default to 1
WHAT I HAVE TRIED?
RewriteCond %{QUERY_STRING} (^|&)from=[^&\s]&to=[^&\s]&x=[0-9]
RewriteRule ^(.*)$ https://arc.abc.com/gbpjpy/x=%3 [R=301,L]
RewriteCond %{QUERY_STRING} !(^|&)x=($|&)
RewriteRule ^(.*)$ https://arc.abc.com/gbpjpy/x=1 [R=301,L]
RewriteRule ^([^/]*)([^/]*)/([^/]*)\.html$ /mconvertar.php?from=$1&to=$2 [L]
I really appreciate your help, Spent a lot of time