Khanh Hoang - Kenn
Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.
The modern Web is a dynamic place. However, sometimes it's necessary (or desirable) to remove the dynamic functionality of a website, while preserving its static content.
Inspired in part by Karen Stevenson's excellent blog post, "Sending a Drupal Site into Retirement," I wanted to outline a few other techniques for accomplishing this.
Reasons you may want to create a static copy of a site:
Wget is a cross-platform command-line program for retrieving web pages. It's almost like it was built to do this.
Run the following code to crawl www.example.com and save it as flat files to an arbitrary directory of your choosing (noted by /path/to/destination/directory): wget -P /path/to/destination/directory/ -mpck --user-agent="" -e robots=off --wait 1 -E https://www.example.com/
See this code explained on explainshell
If you have a Drupal, WordPress, or MediaWiki site hosted on the Stanford WWW servers (AKA "AFS"), you can use the wget method to create a static copy of your site in cgi-bin.
Assuming you have a site at http://ponies.stanford.edu and it lives at /afs/ir/group/ponies/cgi-bin/drupal.
If it's a Drupal site, you can use the Disable All Forms Module. This module does exactly what it says: it disables allforms. Using it requires Bad Judgement (sic).
This method works well if you may want to revive the Drupal site at some point in the future, but don't want to deal with spammers and other malcontents.
There are a variety of WordPress plugins to create a static copy of a WordPress site.
Bình luận (0)
Add Comment