First, let the program output the URL link after the tag pseudo-static. Because phpcms has a URL rule management function, we can directly add a URL rule in URL rule management, remember the previous ID number, such as 33, which will be called in the code below, as shown below:
{$Tagpai_{$page0000.html
Write the phpcms URL rule in the code, open the phpcms/modules/content/tag. Php file, and find the following code:
$ Infos = $ keyword_data_db-> listinfo ($ where, ''id'desc', $ page, $ pagesize );
Add the following code to this line:
$ Urlrules = getcache ('urlrules', 'commons ');
$ Urlrule = $ urlrules [33]; // call a url rule
Then, run the following code in the file:
$ Infos = $ keyword_data_db-> listinfo ($ where, ''id'desc', $ page, $ pagesize );
To:
$ Infos = $ keyword_data_db-> listinfo ($ where, ''id'desc', $ page, $ pagesize, '', '9', $ urlrule, array ('tag' => urlencode ($ tag )));
The purpose is to add the previously configured url rule to the query statement.
Through the above operation, the URL output at the front end has been changed to a pseudo static form. However, if the URL is output at the front end of the website, you need to modify the template file of the website. Take the default phpcms template file as an example. Open phpcms \ templates \ default \ content \ show.html and find:
{APP_PATH} index. php? M = content & c = tag & a = lists & tag = {urlencode ($ keyword )}
Changed:
{App_path}{urlencode($keyword1_1__1.html
Open phpcms \ templates \ default \ content \ tag.html and set the paging tag
{$ Pages}
Changed:
{Str_replace ("_0.html", "_1.html", $ pages )}
Finally, let the Web server rewrite the link. Take Apache as an example, add the following rewrite rules in the. htaccess file:
RewriteRule ^ (. * )_(%0-9%%%%%.html index. php? M = content & c = tag & a = lists & tag = $1 & page = $2
The URL style shown at the end is as follows: http:/response. The solution is to open phpcms/modules/content/tag. php and find:
$ Tag = safe_replace (addslashes ($ _ GET ['tag']);
Add the following code below:
$ Tag = iconv ("gb2312", "UTF-8", $ tag); // transcode
If not, change the location of "gb2312" and "UTF-8. The above are all the tutorials on the tag tab pseudo-static of phpcms v9. The pseudo-static of phpcms is not much different from that of DedeCMS of Zhimeng. The two can be used for mutual reference.