Simple redirect appending the REQUEST_URI in URL

1.4k Views Asked by At

I am trying to redirect if the REQUEST_URI contains /register/affiliate/32

RewriteCond %{REQUEST_URI} /register/affiliate/32
RewriteRule (.*)  https://affiliate.example.com [R=301,L]

It is working fine but it is also including the REQUEST_URI in redirected URL how may I prevent it, that the URI is not included in the redirected URL?

1

There are 1 best solutions below

0
Abhishek Gurjar On

Try it like this,

RewriteCond %{REQUEST_URI} ^/register/affiliate/32
RewriteRule ^(.*)$  https://affiliate.example.com [R=301,L]