Reputation: 2063
I am struggling to do a simple external redirect (a rewrite really, I don't want to send the user a 3xx response) from one machine to another for web traffic.
The following rule should transparently proxy requests from http://myserver.com/api/users/1 to http://jsonplaceholder.typicode.com/users/1 but instead, I only get 404 Not Found responses from Apache.
RewriteEngine on
RewriteRule "^/api(.*)" "http://jsonplaceholder.typicode.com/$1" [R]
Upvotes: 1
Views: 74
Reputation: 785376
mod_proxy
R
flag and use P
for proxy.Your rule will be:
RewriteRule ^/?api(.*)$ http://jsonplaceholder.typicode.com/$1 [P,L,NC]
Upvotes: 1