ServerSide Proxy Relative Path Problem

Purdue_Pete
Purdue_Pete used Ask the Experts™
on
Hi,
I have a webpage that loads external (remote) URLs like http://www.google.com and http://www.yahoo.com using Server Side Proxy.

It is able to load the page, but has the problem of not able to load images etc. for sites like http://www.google.com because it uses relative path and sites like http://www.yahoo.com uses absolute path.
How can this problem be fixed?

Thanks,
K
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010
Commented:
Yes, see the ProxyPassReverse and ProxyHTMLURLMap instructions on the following page:

http://www.apachetutor.org/admin/reverseproxies

Author

Commented:
Any other solutions without needing to configure web server?
Top Expert 2010

Commented:
Nope
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Author

Commented:
In the web server, are there ways to not specify for URLs - because the domains of URLs are dynamic, i.e. new URL from new domain can be added on-the-fly?
Top Expert 2010

Commented:
Possibly, your being rather vague, please provide a few examples, stating what the user will enter and  the URL their request should end up at.

Author

Commented:
arober11,
Sorry about being vague - I am clueless about what the user will enter. They can enter any URLs - from Google to Yahoo to Weather to AP - whatever they want. I know I am not much help here - but, not in my control what they enter
Thanks,
P
Top Expert 2010
Commented:
Dynamic mapping may be possible, but unless you provide some details of what your trying to achieve I can't help, other than suggest you read: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap 

Author

Commented:
arober11,
As stated in the original question, I am trying to load websites like Google using Server Side Proxy in my web application and Google has relative paths, so images etc. cannot be loaded.

Another option available in the web application is ability for users to add and load remotes sites as well.
This could be any sites, be it weather.com or yahoo.com or news.com - whatever the user wishes..

Now, in the document posted earlier,
http://www.apachetutor.org/admin/reverseproxies

URLs need to be specified in web server to do reverse proxies and solve the relative path problem.
This can be an issue as the user can add whatever URLs they want on-the-fly (which I do not know before-hand) and expect the site to load properly.
It is possible that whatever the URLs they add gets redirected to service, which adds these URLs to reverse proxies and reloads / restart the apache web server. This is usually time-consuming and the user won't wait.

You mentioned in the last comment that dynamic mapping is possible - but, I do not see how without mentioning URLs / domains. Kindly post examples on how to achieve this.

Also, I am not keen on using IFrame.

Hope this makes it clear,
P


Top Expert 2010
Commented:
As you appear to be after a Generic HTTP reverse proxy server Apache is not the right tool for you. Have a look at Squid, or one of the derivatives / bolt on's, see:  http://www.squid-cache.org/Misc/related-software.dyn

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial