redirect subdirectory requests to alternate server:port

1

I'm using the following .htaccess to redirect requests to domain root ( http://example.com ) in apache to an alternate webserver on the same host listening on an alternate port ( http://example.com:XXXXX ):

RewriteEngine On
RewriteRule ^$ http://127.0.0.1:XXXXX/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:XXXXX/$1 [P,L]

How may I change the rules to redirect only request to a specific subfolder ( http://example.com/my-app/ ) ? So that requests to http://example.com/ will be served from server http://127.0.0.1:80 and requests to http://example.com/my-app/ will be served from server http://127.0.0.1:XXXXX

Luky

Posted 2018-03-05T17:21:47.100

Reputation: 111

No answers