Reputation: 5921
I would like to implement a kind of a proxy system, where I can type url like this: http://example.com/www.stackoverflow.com and get contents of www.stackoverflow.com returned. What I tried is this:
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/external/.*
RewriteRule ^/(.*) http://%{HTTP_HOST}/external/$1 [NC,R=302,L]
ProxyPassMatch /external/([A-Za-z]*)/(.*) wwww.stackoverflow.com/$1/$2
ProxyPassMatch /external/(.*) http://$1/
This works fine, but works only for stackoverflow.com because it is hardcoded. Is there some kind of rule so that dynamic URL can work, so I can use http://example.com/yahoo.com ? And yes, if try to hardcode yahoo.com or google.com, instead of rewrite url get automatically redirected to yahoo.com or google.com, what's up with that ?
Upvotes: 0
Views: 113