I need to redirect all requests concerning a folder to another (old) web server called www2 keeping the entire original path, for example
https://www.example.org/thisfolder/maps/map.jsp?id=2345 must be redirected to https://www2.example.org/thisfolder/maps/map.jsp?id=2345
I think the solution is to use the mod_rewrite module with RewriteRule directive and should be quite simple, but I cannot find a working example. I tried with
<IfModule !mod_rewrite.c>
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>
<Directory "/thisfolder">
RewriteEngine On
RewriteBase "/thisfolder"
RewriteRule "(.*)" "https://www2.example.org/$1"
</Directory>
This is an Apache2.4 installation running on Linux CentOS 7.6 (Red Hat Enterprise). Thank you so much for your help!