Index of /Andrej Ciho/Blog/WordPress/WordPress (or any CMS) to html files

  Posted
Back Parent Directory 2007-06-18 20:37

Can you host a website made in WordPress on IIS? Or one made in DotNetNuke on Apache? Yes! Now I am NOT about the describe how you can run those application where they weren’t meant to run. I’ll just show you how you can have a CMS spit out plain html files – no need for database or server-side scripting.

Yes, I’m probably crazy – I understand that situations where this would be applicable are only a few. That’s because my “solution” will work well (without additional labor) only for “static” websites – no forms (including contact/comment forms). I’ll list a few applicable situations at the bottom of this post.

  1. Let’s say you created the website and set it up under http://localhost/mywebsite. (If it is WordPress, you may need to change the relative references in your theme’s css to absolute)
  2. In your Linux terminal or Cygwin on your Windows machine, run the following wget command:
    wget --html-extension --recursive --page-requisites --progress=bar --mirror http://localhost/mywebsite

    This will generate an html file for every page of your website.

  3. Once you have all the files, you will want to mass find-and-replace all instances of localhost/mywebsite to e.g. www.andrejciho.com. The script below is a powerful one. It finds and replace stuff inside of all files under a folder, no matter how deep inside the directory structure:
    find . -type f -exec sed -i 's/localhost\\/mywebsite/www.andrejciho.com/g' {} \\;

Possible applicable situations:

 


This website is powered by WordPress, using the IndexOf theme.