Converting a dynamic PHP/mySQL website to an archived HTML version?

寵の児 提交于 2019-12-04 18:53:46

I have recently used the following to good effect:

wget --mirror -w 2 -p --html-extension --convert-links -P folder_to_save_to http://mysite.com

You might need to use the full path to your wget script. This will change all the links so that your site is fully static and self contained.

If you have shell access to any linux machine (perhaps even your own webserver would suffice), I'd recommend that you just spider and download a mirror of your own site using wget. Wget is a utility which is designed to mirror sites as flat files, and it has been in use for quite some time. I believe it should serve you well:

http://www.gnu.org/software/wget/manual/wget.html

I hope that's helpful.

Chris

Using PHP you could write a simple script that would do this:

  1. Save current page.
  2. Follow links from that page and saving those pages (and for each page repeat from 1).
  3. Replace URLs on current page with those leading to saved pages.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!