Skip to content

Instantly share code, notes, and snippets.

@claudiu-cristea
Last active October 27, 2019 11:53
Show Gist options
  • Save claudiu-cristea/8a108d11ce0c3ea4c3af to your computer and use it in GitHub Desktop.
Save claudiu-cristea/8a108d11ce0c3ea4c3af to your computer and use it in GitHub Desktop.
Park your old Drupal site
DirectoryIndex index.html
Options -Indexes
mkdir ~/static
cd ~/static
httrack http://arad2012.drupalcamp.ro -O . "arad2012.drupalcamp.ro/*" -N "%p/%n/index%[page].%t" -WqQ%v —robots=0
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\.\.\/index\//\.\.\//g"
cd ~/static
cp index/index.html .
sudo apt-get install httrack
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\/index.html/\//g"
# Using perl instead of sed because sed behaves differently on Linux vs. MacOS.
perl -i -pe's/\.\.\///g' index.html
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\"index\.html\"/\"\.\"/g"
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/index\.html\#/\.\#/g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment