URL relativizer

I have a tree of HTML documents linked in an 'absolute' manner. Is there some application that could help me to relativize links in HTMLs?

e.g: index.htm is located in c:\root and contains link to page1.htm as c:\root\pages\page1.htm
I would like to transform this link into ./pages/page1.htm
Who is Participating?
KennyIT Application ExecutiveCommented:
A PERL script could probably be written to do the job. Or even PASCAL. Are you a programmer?
milicicdAuthor Commented:
I would prefer some finished program doing that. Can Dreamweaver fix it?
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

2 step process.
1. Search for "c:\root" and replace with "" (nothing)
2. search for "\" and replace with "/"
(I as long as you don't use c: or \ elsewhere)

For mulitple file replacement use a text editor such as ultra edit.

the best way to get this done is using asp
mystring = replace(mystring,"c:\root","")
mystring = replace(mystring,"\","/")
If you are talking about replacing these strings "manually", i.e. doing a pass through the file, looking for the string, and replacing it, there are several editors, e.g., Visual InterDev and HomeSite, which will do this for multiple files.

I wouldn't be surprised if Dreamweaver could do it, but I can't verify that.

I know that using HomeSite, you could replace:

"c:\root\pages\" with "./pages/" in all instances in multiple files.

The only thing you need to be REAL careful of is that the strings are exact and that there are no instances you DON'T want changed (like references in the HTML text of the files, etc.)

VID will find all the instances and allow you to verify that you want to change them individually.

Ultra edit will also do this for you (shareware).
BlackWidow can do this for you
irenata - does that justify the answer and hence the points? Surely a comment at the most? That way milicicd can choose who (if anyone) deserves the points! And this also means that the question will still receive the attension of other experts who might otherwise ignore a locked question.

Just my 2 cents. (In the words of Kent Brockman)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.