views:

522

answers:

3

I have all the web pages of a website. My task is to change all HTML files to .asp files and change the links... I have about 280 HTML files.. is there any software or web service which can read a website and show me all the link structures (to make my job easier)... similar to a site map.

A: 

If the links use relative paths, all you have to do is to change the .html file extensions to .asp and place the files on a server that can run ASP.

If they are absolute paths, you can get away with editing your hosts file to point the original domain to your own server and just place the untouched files on your server.

If you really need to replace the URLs, try a text editor like UltraEdit or Notepad++ (on Windows) that can do find/replace over files (and use regular expressions for the search phrase). Or you can use sed or Perl on Linux.

Ates Goral
+1  A: 

in unix :

  • find . -type f -name '*html' | awk '{ print "mv " $0 " " substr($0,0,length($0)-4)} | sh'
  • find . type f -name '*asp' | xargs perl -PI -e 's/\.html/\.asp/g;

That should do it.

If you are using Windows, install cygwin ;)

Julien Grenier
A: 

Dreamweaver has the ability to rename a file and change all links site wide at the same time. I think it depends on relative and/or absolute (starting with / not http) filenames so will not work if there are any links that look like external ones i.e. starting with http.

Other than that, I would recommend writing a simple python/perl/ruby(etc) script to do it pretty simply.

Geoff