WordPress page static and static file can not generate problems

Source: Internet
Author: User
Tags cos create index php script

Let's download the Cos-html-cache 2.7.3 page static plugin

1. The Install plugin page searches the Cos-html-cache plug-in, and installs
1. Create HTML folder under root directory, permission 777
2. Create index.bak files under root directory, permissions 666
3. Modify the fixed connection format as a custom structure,/html/%post_id%_%postname%.html
4. Activate the plugin
5. Modify the site default first order, add a line in. htaccess:

DirectoryIndex index.html index.htm index.php index.cgi
6. Modify the Subject search box code, in the searchform.php file, will

The code is as follows Copy Code

action= "<?php Echo esc_url (Home_url (/));?>"
To be replaced by:

action= "<?php Echo esc_url (Home_url (/index.php));?>"

Inspection:

Exit login, re-access page, generate HTML file in HTML directory, and include string <!–cos-html-cache-in page source code

Safe-tag–> is installed successfully.

Problems that cannot be generated by static files


Because some server-defined document_root is inconsistent with the directory path of the virtual space, COS-HTML-CAHCE cannot find the correct directory to generate

HTML, such as the 000webhost server.

There is one row in the cos-html-cache.php file:

$path = $_server[' Document_root ']. " /";
The solution can use a PHP script to test your host's space path, and then change the value of the $path to the space root directory path.

You can create a PHP file that writes the following code.

The code is as follows Copy Code

<?php echo "Severpath:". DirName (__file__); echo "<br/>"; $path = $_server[' Document_<div

Style= "Display:none" ><a title= "how to increase vertical jump" href= "http://howverticaljump.com/" >how

To increase vertical jump</a>
ROOT ']. " /"; echo "Document_root:" $path;?>


Then upload to the space root directory, Access script files, compare, view document_root and space path, if inconsistent, modify $path

Value can be.

For example visit: http://111cn.net/root_test.php, return Result:

The code is as follows Copy Code

Severpath:/home/a4675762/public_html
Document_root:/usr/local/apache/htdocs/

You can see that two paths are completely different, then modify $path to:

The code is as follows Copy Code

$path = "/home/a4675762/public_html/";

OK, log out of the blog (be sure to log out to generate HTML static page), and then visit the page again, HTML should be able to generate normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.