Phpcms V9 static HTML generation settings and URL rule optimization

Source: Internet
Author: User

First talk about Phpcms V9 in the background how to set up static HTML, and then explain how to customize the URL rules, URL address optimization. In this article, pseudo-static does not involve, we can step to phpcms V9 full station pseudo-static setting method.

First, static HTML generation settings

Enter Phpcms V9 background settings, find categories, Location: Content--management columns, add columns (or manage columns, click the corresponding column "modify"):

Note Set the second tab, "Generate HTML Settings", specific screenshot:

After confirming the submission, remember to update the column cache, and then publish the management: Bulk update the column page, the bulk update content page.

Second, phpcms V9 custom URL rules and URL address optimization

First understand the HTML generation principle of PC V9:

Phpcms generated static page directory rules are generated according to the URL rules, static page content is Ob_clean the foreground template file generated Phpcms\templates\default, static page debugging: Modify static page, regenerate static page again look effect, can also call foreground control /index.php?m=openservice&c=index& A=openservice Modify the foreground template to regenerate.

As long as the static page links to synchronize files in a timely manner, to prevent dead links, data errors.

Based on this, we can customize the URL generation rule in the Background Extension URL rule management, specific location: extension > URL rule management.

On the next page, you will share Cmsyou's knowledge and examples of optimizing URL generation rules.

1, the default column generation rules are:

{$categorydir} {$catdir}/index.html| {$categorydir} {$catdir}/{$page}.html

When the HTML is generated, it will be displayed as: news/cmsyou/1000.html.

This is a little bit of a problem, if the list has more than one page, then the second page is just to generate a number of HTML, such as 2.html for the second page of the list, Cmsyou proposed to modify:

{$categorydir} {$catdir}/index.html| {$categorydir} {$catdir}/index_{$page}.html

According to the column index page generated, column list into: index.html, index_2.html, index_3.html ... This is quite clear.

If you want to customize the build to a fixed directory, you can add a specific English directory in front of it.

2. The default generation rule for the article page is:

{$year}/{$catdir}_{$month} {$day}/{$id}.html| {$year}/{$catdir}_{$month} {$day}/{$id}_{$page}.html

Or:

{$categorydir} {$catdir}/{$year}/{$month} {$day}/{$id}.html| {$categorydir} {$catdir}/{$year}/{$month} {$day}/{$id}_{$page}.html

The HTML page directory generated by such a rule is too deep, cmsyou suggested to be modified to:

{$categorydir} {$catdir}/{$id}.html| {$categorydir} {$catdir}/{$id}_{$page}.html

This generated HTML static file, just at the root of the column, so easy to manage, but also conducive to SEO. For example http://www.cmsyou.com/support/84.html this, is in Cmsyou help article below an article, remove the back of the 84.html is the column home page, so direct.

3. Single page generation rule optimization

There is only one way to generate the default single page, Cmsyou recommends adding one:

{$categorydir} {$catdir}.html

So a single page of the level two catalog generates only one HTML, not a directory, which facilitates the HTML schema. Share Settings screenshot:

In this way, specifically to share the phpcms V9 columns, inside pages, single page generation rules and optimization examples, do you know the custom HTML generation rules?

Phpcms V9 static HTML generation settings and URL rule optimization

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.