这是我配置的路由

use think\Route;

Route::get('/',function(){
return 'Hello World';
});
Route::get([
'news/:id/:name'=>'api/News/read',

]); 

访问路由地址 http://localhost/shopapi/news/3/1

ThinkPHP5 Route 访问原地址非法请求

访问原地址 http://localhost/shopapi/api/news/read/id/3/name/1

ThinkPHP5 Route 访问原地址非法请求

在ThinkPHP5路由中有说明 

ThinkPHP5 Route 访问原地址非法请求


如果想要原地址和路由地址可以同时访问,设置config中默认模块名为你路由的模块名 

路由设置ThinkPHP5 Route 访问原地址非法请求,这样就可以同时使用了。

原理的话没有具体查找过。

相关文章:

  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2021-10-01
猜你喜欢
  • 2021-04-14
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-11-10
相关资源
相似解决方案