#!/usr/local/bin/perl # moved.cgi December 23 1996 Dale Bewley # # Simple demo script that goes along with: # http://www.bewley.net/httpd/how_do_i/move_a_site.html # # Use it to redirect a jumbled up directory of html files to new their # nicely organized new homes. while () { ($old_file, $new_url) = split(/\s+/); if ($ENV{PATH_INFO} =~ /^\/$old_file$/) { print "Location: $new_url\n\n"; } } # below is a url map. The file name on the left is assumed to to be # within the old jumbled up directory. That thing on the right is the new # URL for this file of course. __DATA__ cgi.html http://www.bewley.net/cgi/ perl.html http://www.bewley.net/perl/ httpd.html http://www.bewley.net/httpd/ cookie-test.html http://www.bewley.net/perl/cookie-test.html