Used to weave dreams, Wordpress, Zblog and other programs, users know that when the content can be customized to generate HTML file name, this feature is very good for SEO, but after V9 but unfortunately, this function is not, Now all you have to do is make a small change to V9 to make V9 have the ability to customize the HTML file name, by doing the following:
1, modify the model you need to set, add a field, configured as follows:
2. Open the/phpcms/modules/content/create_html.php and find the code:
$urls $this->url->show ($r$r[' catid '],$r[' inputtime ']);
Bulk replacements are:
$urls $this->url->show ($r$r[' catid '],$r$r[' prefix ']);
A total of three code to allow the generated HTML page to customize the file name.
3. Open the/phpcms/modules/content/classes/url.class.php and find the code:
$day Date (' d ',$time);
Insert below:
$tmp _id $content _ishtml $prefix $prefix $id // added support for custom HTML file names
Find the code again
$urls Str_replace (array(' {$categorydir} ', ' {$catdir} ', ' {$year} ', ' {$month} ', ' {$day} ', ' {$catid} ', ' {$id} ', ' {$page} '), Array($categorydir,$catdir,$year,$month,$day,$catid ,$id,$page),$urlrule);
Modified to:
$urls Str_replace (array(' {$categorydir} ', ' {$catdir} ', ' {$year} ', ' {$month} ', ' {$day} ', ' {$catid} ', ' {$id} ', ' {$page} '), Array($categorydir,$catdir,$year,$month,$day,$catid ,$tmp _id,$page),$urlrule);
Here, the name of the generated HTML page is customized. Configure the URL rules later, still using the form of ID.
PHPCMS v9 Custom HTML file name