HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Change filename from html to php
Author: Xavier Roche
Date: 10/10/2003 23:02
 
> I would like to use httrack to
> mirror pages that are currently named *.html, renaming 
them
> to *.php in the process. I also want to be sure that any
> links within the pages point to the renamed (*.php) pages.

Ah - this is not possible with httrack.
But you can use some scripting (bash-style, using a linux 
console, or a windows+cygwin console) for that :

find . -type f -name "*.html" -exec ./myscript {} \;

With a "myscript" script such as:

#!/bin/sh
#
test -f "$1" || exit 1
cat "$1" | sed -e "s/\([\"']\)\([^\"']*\)\(\.html\)\([\"']
\)/\1\2\.php\4/g" > "${1%.*}.php"
rm -f "$1"
 
Reply Create subthread


All articles

Subject Author Date
Change filename from html to php

10/10/2003 17:08
Re: Change filename from html to php

10/10/2003 21:05
Re: Change filename from html to php

10/10/2003 22:30
Re: Change filename from html to php

10/10/2003 23:02
Re: Change filename from html to php

10/10/2003 23:16




6

Created with FORUM 2.0.11