'Apache2 Virtual Host redirect according to a specific path

I am having trouble setting up the apache server.

test.sample11.com/abc --redirect--> test.sample22.com/abc
test.sample11.com/def --> do nothing
test.sample11.com/ghi --> do nothing

Requests to access my server must be redirected as above.

In the case of abc, the parameter and post value must be redirected together.

I wrote a vhost as below for this,

<VirtualHost *:80>
  ServerName test.sample11.com
  ProxyPreserveHost Off
  ProxyPass /abc/ test.sample22.com/
  ProxyPassReverse /abc/ test.sample22.com/
  RedirectMatch ^/abc$    /abc/
</VirtualHost>

but it doesn't work properly.

Is this wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source