ThinkPHP3.1.3 when routing is enabled, its paging address is not the address of the route, because thinkphp3.2.1 code is not repaired, many people have encountered this problem, this article adopts the Olcms modification method to solve this problem, especially thanks to Phper Jack's contribution to this, the specific solution is to modify the thinkphp of the functions.php U method, around 287 lines:
if (!empty ($vars)) {
///Add parameter
foreach ($vars as $var => $val) {
if ('!== trim ($val))
$url. = $depr. $var . $depr. UrlEncode ($val);
Add the following code later
* * TP Open Routing after the next page routing failure Problem page class URL assembly//If Open route if (C (' url_router_on ')) {foreach (C (' Url_route_rules ') as $zhaolg => $zlig) {//Traverse route if (strstr) ('/'.
Group_name. $url, $zlig)) {//Find the routing rule from the URL $lg = strstr ($zhaolg, '/: '), and/or parse rule with parameters?
if ($LG) {//If the rule takes the parameter $tempzlg = Str_replace ('/: ', ', $LG);//Fetch parameter//dump ($TEMPZLG); if ($TEMPZLG) {if (C (' App_sub_domain_deploy ')) {$zlgurl = Str_replace ($zlig, $zhaolg, '/'. Group_name. $url);
The URL is replaced by the routing rule}else{$zlgurl = Str_replace ($zlig, $zhaolg, $url);//url Replace with routing rules}
Note/s/:c/c/4/p/__page__//dump ($zlgurl);
$url = Str_replace ($lg. '/'. $tempzlg, ', $zlgurl);//url replacement Routing rule parameter}}else{//analysis rule takes no parameters if (C (' App_sub_domain_deploy ')) {$url = Str_replace ($zlig, $zhaolg, '/'. Group_name. $url);//url replaced by routing rule}else{= Str_replace ($zlig, $zhaolg,$url);//url replaced by Routing rules}}}
This problem is resolved!