I want to redirect
https://www.aaa.com/query?v=abc123_ABC
to:
https://bbb.com/?url=https://www.aaa.com/query?v=abc123_ABC
I use this in .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ https://bbb.com/?url=https://www.aaa.com/$1 [L,B,NE,NC,QSA,R=301]
</IfModule>
But the output is:
https://bbb.com/?url=https://www.aaa.com/query&v=abc123_ABC
The ? was converted into &, what’s wrong with the code?
Thanks.
====
You can test it here:
https://htaccess.madewithlove.be/
2
Answers
As per OP’s request and shown samples could you please try following.
The following rule should work.