在做一個項目,在項目完成之后,配置一下路由,讓URL更容易美觀。
下面是具體的配置: Common / Conf / config.php
// 路由處理 'URL_HTML_SUFFIX'=>'html|shtml|xml',//限制偽靜態的后綴 'URL_ROUTER_ON'=>ture,//開啟路由 'URL_ROUTE_RULES'=>array( '/^doc\/list(\d)/' => 'Index/index?p=:1', 'doc/index' => 'Index/index', 'doc/:id\d' => 'Index/details', 'doc' => 'Index/index', ),
上面的配置完成之后:
訪問: /index.php/doc/index 相當於訪問: /index.php/Index/index.html 訪問: /index.php/doc/2.html 相當於訪問: /index.php/Index/details/id/2.html 訪問: /index.php/doc/ 相當於訪問: /index.php/Index/index.html
