Issue
I'm hitting the URL http://example.com/ws/abc. Now I need to proxy a server with URL rel="nofollow noreferrer">https://server.com/abc.
I have tried 2 below methods to proxy. But its not working.
RewriteRule ^/ws/(.*) "https://server.com/$1" [P]
ProxyPassMatch ^/ws/(.*) https://server.com/$1
What is the possible issue?
I can't seem to get just the abc
from the URL. I get /ws/abc
.
Solution
The RewriteRule and ProxyPassMatch you are using match exactly the same so only the RewriteRule is being interpreted, I suggest you take a more simple approach just with proxypass directives. If I understood correctly what you are trying to proxy it would be like:
ProxyPass /ws/ https://server.com/
ProxyPass /abc/ https://server.com/
First will match everything after /ws/ and append it to https://server.com/, second will match everything after /abc/ and append it to https://server.com/
Answered By - ezra-s Answer Checked By - Clifford M. (WPSolving Volunteer)