If your website is running on localhost:4567, these commands will mirror it into a directory named 'root'.  The content will be purely static, and it will have relative paths so you can host it pretty much anywhere.


Do this:

rm -rf root
wget -r --adjust-extension --convert-links -D localhost http://localhost:4567/Home
mv localhost:4567 root
cp root/Home.html root/index.html

The rm -rf ensures that we start afresh every time -- there's no way for data from the previous run to screw things up.

-r means recursive, spider everything.

--adjust-extension ensures that all files have typical MIME-compliant extensions.  Without this step, you might see HTML pages displayed as plain text or vice versa.

--convert-links ensures that all links are relative, allowing this content can be served pretty much anywhere.

-D localhost ensures the spider only saves local content.  We don't want it following links onto other sites.

That last step (creating index.html) ensures that visitors see your homepage, not an index of all the files in this directory.


To try your spidered content locally, fire up a static webserver on the root directory:

ruby -run -ehttpd root -p8000