Current location: home page > ZBP Tutorial >Body

ZBLOGPHP pseudo static setting details

 weijingtai.jpg

This tutorial combines ZBLOG From Getting Started to Giving Up Episode 3 Better eating effect

Listen to the Water God, and put the plug-in in front. Well, this plug-in is made by the Water God.

First, recommend a pseudo static setting artifact:

Pseudo Static Settings Assistant

After installing and enabling this plug-in, click one click setting in the static management center and submit

 Pseudo static. png

If this plug-in has met your needs, you don't need to read the following content.

The following part is reproduced from the Flying Bird Muyu blog, with the original link: https://www.feiniaomy.com/post/469.html

Zblog pseudo static rule parameters

{% host%}: indicates the web address, ending with '/'

{% category%}: indicates the classification. If the classification has an alias, call the alias. If there is no alias, call the name

Note: This parameter only appears in the URL configuration of the article

{% alias%}: indicates the alias of the call. If there is no alias, call the title or name

Note: This parameter will appear in the URL configuration of the article page, page, category, tab, and author page

{% id%}: represents the ID number of data stored in the database, expressed in numbers

Note: this parameter will appear in the url configuration of author page, tab page, category page, article page and page

{% year%}: indicates the year when the data is newly created, such as 2019, 2018, etc

{% month%}: indicates the month when data is newly created, such as 05 12

{% date%}: indicates the time period, which is not commonly used. It is generally used for ur configuration of date pages

{% page%}: represents the number of pages in a number

Note: This parameter only appears in the url configuration of some list pages, such as home page, article list, tag list, author article list, and date page list

Pseudo static urls can be combined with some strings using the above parameters, but pay attention to several points

1. {% host%} The '/' symbol cannot appear when the parameter is combined with other strings or parameters

2. In addition to the {% host%} parameter, the combination of other parameters can use the '/' symbol

3. When the {% alias%} parameter is used, the output result must not contain Chinese or other special symbols

4. The url configuration of the list page must contain the {% page%} parameter, or a bug will occur

5. You can refer to the following examples to configure the url

Example of pseudo static setting of zblog article url page:

Example:

 {%host%}post/{%id%}.html

Output:

 http://www.xxxxx.com/post/1.html http://www.xxxxx.com/post/2.html

explain:

1. {% id%} represents the ID number of the article

2. The post character can be changed to other characters, such as artifice

Example 2:

 {%host%}post/{%alias%}.html

Output:

 http://www.xxxxx.com/post/abc.html http://www.xxxxx.com/post/fdk.html

explain:

1. 'abc' and 'fdk' are the alias of the article output by the {% alias%} parameter when editing. If they are not set, they are the title of the article.

2. Try not to use Chinese characters or special characters for aliases

Example 3:

 {%host%}{%category%}/{%id%}.html

Output:

 http://www.xxxxx.com/html/1.html http://www.xxxxx.com/css/2.html

explain:

1. The html and css output by the {% category%} parameter represent the classification of the current article

2. {% category%} Call the alias of the classification. If not set, call the name of the classification

3. Alias shall be expressed in pinyin or string as far as possible, and Chinese characters shall not appear

URL configuration of zblog homepage

The configuration of zblog homepage url is very simple compared with the url configuration of other pages. You only need to set its paging format.

Example 1:

 {%host%}page_{%page%}.html

Output:

 http://www.xxxxx.com/page_2.html

Example 2:

  {%host%}page/{%page%}/

Output:

 http://www.xxxxx.com/page/2/

explain:

1. The homepage url configuration only needs the setting of {% page%} parameter

2. The set url form only appears if it is not the first page

3. Any letters can be added for combination

URL configuration of zblog classification page

The URL configuration of zblog classification pages is more complicated, mainly because of the addition of a paging parameter.

Example:

 {%host%}{%alias%}/{%page%}/

Output:

 //Page 1 http://www.xxxxx.com/cate/ //Page 2 http://www.xxxxx.com/cate/2/

explain:

1. {% alias%} indicates the alias of the classification. If there is no alias, use the name

2. The second page of the classification has more parameters than the first page (the first page is not displayed by default)

Example 2:

Use the ID parameter of the classification

 {%host%}category-{%id%}_{%page%}.html

Output:

 //Page 1 http://www.xxxxx.com/category-1.html //Page 2 http://www.xxxxx.com/category-1_2.html

Example 3:

 {%host%}category/{%id%}/{%page%}

Output:

//Page 1

 http://www.xxxxx.com/category/cate/ //Page 2 http://www.xxxxx.com/category/cate/2/

Supplementary notes:

1. Each configuration of zblog's pseudo static plug-in has default options, which can be selected by yourself

2. Chinese characters should not appear in the configured URL address and should not be repeated

3. If there is no special need, try not to use index.php pseudo static

4. After setting the pseudo static, you need to configure the ReWrite rule

Comment

  • two thousand two hundred and twenty-six Participation, two Comments