Is there a way to spoof the URL of an HTML file?

Started by
2 comments, last by DvDmanDT 18 years, 8 months ago
Let me explain first what I'm trying to do. I'm trying to write a program that automatically posts data to a web form and displays the result. I can use curl to send the data alright, and I can pipe the response from the server and do whatever with it. The thing is, if I put it into a file and ask a browser to display it, relative links and images and other data won't resolve correctly - if it's looking for foo.jpeg, it won't find it on my hard drive. Is there a way to tell the browser, "Display this page as if it were www.foo.com/index.html for the purpose of resolving relative links and images?"
Advertisement
I think you'll have to translate all adreses inside files to relative ones. Just like IE does it when saving a page.
______________________________Madman
Isn't there _something_ like <link base="http://..."> ?
However, it wouldn't work for pages with absolute URLs anyway (will never do).


<base href="">
<base target="">

exists.. Might work.. :p

This topic is closed to new replies.

Advertisement