Home > Backend Development > PHP Tutorial > tp3.1.2 路由(伪静态)配置无效,崩溃中,该如何解决

tp3.1.2 路由(伪静态)配置无效,崩溃中,该如何解决

WBOY
Release: 2016-06-13 11:46:04
Original
1143 people have browsed it

tp3.1.2 路由(伪静态)配置无效,崩溃中
config.php下:

<br />'LOAD_EXT_CONFIG' => 'routes',<br />'URL_HTML_SUFFIX' => 'html',<br />
Copy after login

routes.php下:
<br />return array(<br />    'URL_ROUTER_ON' => true,<br />    'URL_ROUTE_RULES' => array(<br />        'a/b/:id' => '/Api/verify/:1',<br />    ),<br />);<br />
Copy after login

但是当我访问xxx.com/a/b/1.html时,报错:无法加载模块:A

求助
------解决方案--------------------
访问xxx.com/a/b/1这个呢?应该没问题吧
------解决方案--------------------
确定你a控制器文件是否存在?还有a控制器命名是否满足驼峰式写法?
------解决方案--------------------
试试xxx.com/index.php/a/b/1.html
------解决方案--------------------
写到config.php里吧
'URL_ROUTER_ON'=>true,<br />'URL_ROUTE_RULES'=>array(<br />        '/^index$/'=>'Home/Index/index',<br />        '/^admin$/'=>'Admin/Index/index',<br />)
Copy after login

如果使用了独立分组要写到最外层公用config.php里面

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template