PHPCMS程序中已经默认包含了 apache 伪静态规则,但是如果您使用IIS则需要自己转换一次。
apache 规则
将规则放在根目录.htaccess文件中
RewriteEngineon
RewriteRule ^content-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3
RewriteRule ^list-([0-9]+)-([0-9]+).html index.php?m=content&c=index&a=lists&catid=$1&page=$2
IIS7/IIS8规则,
将规则放在根目录web.config文件中
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”Imported Rule 1″><match url=”^content-([0-9]+)-([0-9]+)-([0-9]+).html” ignoreCase=”false” />
<action type=”Rewrite” url=”index.php?m=content&c=index&a=show&catid={R:1}&id={R:2}&page={R:3}” appendQueryString=”false” /></rule>
<rule name=”Imported Rule 2″><match url=”^show-([0-9]+)-([0-9]+)-([0-9]+).html” ignoreCase=”false” /><action type=”Rewrite” url=”index.php?m=content&c=index&a=show&catid={R:1}&id={R:2}&page={R:3}” appendQueryString=”false” /></rule><rule name=”Imported Rule 3″><match url=”^list-([0-9]+)-([0-9]+).html” ignoreCase=”false” /><action type=”Rewrite” url=”index.php?m=content&c=index&a=lists&catid={R:1}&page={R:2}” appendQueryString=”false” /></rule></rules></rewrite></system.webServer></configuration>