Index of /andrejciho/WordPress/WordPress (or any CMS) to html files

Post Title Posted Description
Back Parent Directory
WordPress (or any CMS) to html files 2007-06-18 20:37

Can you host a website made in WordPress on IIS? Or one made in DotNetNuke on Apache? Sort of.


Be Sociable, Share!

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:
    1
    <code>wget --html-extension --recursive --page-requisites --progress=bar --mirror http://localhost/mywebsite</code>

    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:
    1
    <code>find . -type f -exec sed -i 's/localhost\\/mywebsite/www.andrejciho.com/g' {} \\;</code>

Possible applicable situations:


Leave a Comment
*Required
*Required (Never published)
 

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

This website is powered by Wordpress