Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I need to change all the relative urls found on a webpage to absolute urls.
Now i know that if the webpage's name is "http://www.hello.com/index.html" then for every relative url found on the webpage, example "tree.html", i must append to it the hostname of the webpage, that is, "http://www.hello.com/tree.html"
But what if that is not the hostname it needs?
For example what if "http://www.hello.com" is a page that is part of the main page called "http://www.greetings.com" and therefore every relative url found on the "http://www.hello.com" page require the hostname of the "http://www.greetings.com" page.
How can I accomodate this?
I am using HttpClient and i am not sure if it does this automatically.
In general, relative URLs can save a lot of time & headache by making your website more portable. Where are these URLs, specifically, that need changing? In your HTML? Unless you're running a huge website (in which case you'd already have a better solution) I'd just do a quick search/replace on a by-file basis. Put careful thought into why you want absolute URLs, maybe your webpage just needs restructuring.
You have to be odd to be #1 - Seuss. An odd little ad:
Free, earth friendly heat - from the CodeRanch trailboss