Skip to content

Instantly share code, notes, and snippets.

@wesort
Created July 4, 2024 12:37
Show Gist options
  • Save wesort/849f3c6d35464a8b02cea105cc1bb95b to your computer and use it in GitHub Desktop.
Save wesort/849f3c6d35464a8b02cea105cc1bb95b to your computer and use it in GitHub Desktop.
wget command to archive a website
wget -e robots=off --mirror --page-requisites --convert-links --adjust-extension --no-if-modified-since --no-check-certificate --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36" https://example.com
@wesort
Copy link
Author

wesort commented Jul 4, 2024

Archive a website using wget

  • Use this command to download a static version of an existing, live website
  • Warning: your mileage may vary!

Running the command

  • On your machine or server, nav to a suitable directory or create a new "site" if using Laravel Forge
  • Adjust domain at the end of the command
  • The site will download to the current directory putting the entire site into a new directory using the domain name as the directory name.
    • ie: for https://example.com, the whole site will be in example.com/
  • To move the site "up" one level, run mv example.com/* . then rm -rf example.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment