homepage Welcome to WebmasterWorld Guest from 54.166.173.147
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
How can I change ALL links from absolute to relative?
Have to burn a cd with my site on it...
gutabo




msg:962393
 4:31 pm on Nov 12, 2002 (gmt 0)

Thing is, it would be easier to do online(just find and replace "www.foobar.com" with "/") but I have to change ALL the links in my site so they will work on a cd!
Any1 knows a fast way to do this?
Thanks in advance!

 

incywincy




msg:962394
 4:38 pm on Nov 12, 2002 (gmt 0)

in unix you could edit all your html files using sed.

if you had a whole bunch of *.html files you would create a file say called editfile, this file would contain:

s/http:\/\/www\.foobar\.com\///g

then edit all the files using the following command
sed -f editfile *.html

the edit file can contain multiple lines, each doing a different substitution.

gutabo




msg:962395
 4:45 pm on Nov 12, 2002 (gmt 0)

Thanks, but I don't have any kind of access to unix...
And I want to change all the links in a COPY of the site(that will get burned on a cd) so all of the links will work in a local/cd site...
Thanks!

BlobFisk




msg:962396
 4:52 pm on Nov 12, 2002 (gmt 0)

There is a probuct out there called Search and Replace [funduc.com] which will grep an entire directory for a specified file type (in your case *.html), and replace a search string (www.foobar.com) with a new string... it runs on Windows.

This might be what you're looking for?

andreasfriedrich




msg:962397
 4:58 pm on Nov 12, 2002 (gmt 0)

Did you consider putting a web server on the cd as well? This way you could even run PHP or Perl scripts. Just make sure that the server may write its logfiles to a directory on your hd.

Andreas

sun818




msg:962398
 5:11 pm on Nov 12, 2002 (gmt 0)

If you want to burn your web site to a CD, try a web site grabber like wget or pavuk. For wget the syntax is:

wget -r -k [yourwebsite.com...]

-r is for recursive
-k is to convert non-relative URLs to relative

To find the free program, a google search on wget win32 will work

gutabo




msg:962399
 5:23 pm on Nov 12, 2002 (gmt 0)

That was exactly what I needed! Thanks!
And does it works if I have a backup copy of my site and I try wget -r -k d:/Midget/Giant/mysite/?
Thanks in advance!

sun818




msg:962400
 6:14 pm on Nov 12, 2002 (gmt 0)

Sorry, I do not know. Feel free to try it out yourself.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved