Feed:rss
  • Make all wordpress’ posts to real html files on Godaddy’s webhosting by j2trip on 11:48 PM Comments (0)


    In order to decrease the load of webhost and SEO, I decided to make all posts to real html file. I search plugins on wordpress’ plugin directory. And I found cos-html-cache, this plugin is popular and still maintained by its author. The author is a Chinese. I appreciate to his work. I download the version 2.7.3  from here:  http://wordpress.org/extend/plugins/cos-html-cache/ .  My wordpress’ version is 2.8.2.

    First, I set the permalinks to custome setting with /html/y%year%/%monthnum%/%postname%.html.

    20091005-make-all-2-html-1

    I follow the author’s instructions in readme.txt.

    1.Upload to your plugins folder, usually `wp-content/plugins/` and unzip the file, it will create a `wp-content/plugins/cos-html-cache/` directory.

    2.Activate the plugin on the plugin screen.

    I’m a beginner of wordpress. When I first activate one plugin, I cost more time to find out the plugin’s setting page.  Follows image will help beginner to find out it quickly.  : )

    20091005-make-all-2-html-2

    plugins in wordpress

    After activate the plugin, please click “Settings”, when the drop list displayed you’ll find the plugin’s name. Then click it, it will bring you to plugin’s setting page.

    20091005-make-all-2-html-3

    plugin setting page

    3.Make sure that you deactivated compression on the Miscellaneous options screen and that gzip encoding is turned off on the PHP level.

    When I open the page of  “Settings–>reading”, I can’t find any gzip option.   What I saw was following image:

    20091005-make-all-2-html-4

    wordpress gzip option

    I search the help for gzip option,  finally I  got it. The gzip option has been disabled in wordpress 2.8.2.

    4.create a file named “index.bak” under the root of your web directory

    I created the file, logout wordpress admin. Refreshed the home page of  www.j2trip.com again. Then I go to the root directory by FTP.  Unfortunately I didn’t find any index.html file,  and didn’t find html directory also.

    I checked every step, there wasn’t any error. But why the html files not been generated?

    Setp to fix the problem:

    1. I read author’s FAQ list, crated a directory under the root of  www.j2trip.com with it’s name html . Also change it’s mode to 777(linux server).  Refreshed the front page, but without any html files still.

    2. I went to the homepage of plugin’s author, read all posts, questions and answers. Fortunately, I find out a page with name: about the question of cos-html-cache on godaddy’s webhosting. I’m using godaddy’s webhost, so may be the page’s content will help me to fix the bug.

    3. I follow author’s instruction,  open cos-html-cache.php, replace $path = $_SERVER['DOCUMENT_ROOT'].”/” to $path = ABSPATH,  logout admin refreshed www.j2trip.com’s homepage again, but I can’t find any html file with FTP. The futher step,  set the $path to $path = ABSPATH.”/yourblogdir/”, but the html file was not generated also.

    4. For now, I didn’t how to deal with. I attempted all instructions, but couldn’t get html yet. My brain was frozen. So I decited to go to bed and fix the problem tomorrow.

    5. The second day, when I login wordpress I suddenly realized that I have used my own theme,  did the problem caused by this? I change the theme to default and logout, refreshed, when I open the root with FTP I saw index.html file. Good news, the plugin worked.  But when I go into the html directory, I couldn’t find any html files for single posts.

    6. I added some debug info into cos-html-cache.php,  echo $path, and I found the path is not right. Because I have replace the $path to ABSPATH.”/yourblogdir/”, so the $path is not valid and the html files for every posts couldn’t be generated. I set the $path = ABSPATH.”/” again, logout and refreshed the special posts. I got the real html file for the special posts.

    I got success.

    PS:

    Forgive me if there’s any error.

  • Leave a Reply:(* means required)

    Name:     *

    Email:     *(will not be published)

    Website:

    Your comment: