thinkphp5动态路由,仿企业网站静态资源目录

use think\Route;
Route::rule("/",'index/index');//pc首页

Route::get('views/:id$','index/views',[],['__url__'=>'views\/\d+$']);//网站地图
Route::rule("sitemap.xml",'index/sitemap');     

Route::rule('wechat/[:p]$','content/wechat','*',[],['p'=>'[a-zA-Z][a-zA-Z0-9_]{1,15}+']);                  
Route::get('wechat/:id$','content/viewwechat',[],['__url__'=>'wechat\/\d+$']);
                                                                                                                                                                                                                    Route::rule('cases$','content/cases');
Route::get('cases/:id$','content/viewcases',[],['__url__'=>'cases\/\d+$']);
Route::rule('cases/case_web/[:p]$','content/case_web','*',[],['p'=>'[a-zA-Z][a-zA-Z0-9_]{1,15}+']);
Route::get('cases/case_web/:id$','content/viewcase_web',[],['__url__'=>'cases\/case_web\/\d+$']);
Route::rule('cases/case_wechat/[:p]$','content/case_wechat','*',[],['p'=>'[a-zA-Z][a-zA-Z0-9_]{1,15}+']);
Route::get('cases/case_wechat/:id$','content/viewcase_wechat',[],['__url__'=>'cases\/case_wechat\/\d+$']);
Route::rule('cases/case_market/[:p]$','content/case_market','*',[],['p'=>'[a-zA-Z][a-zA-Z0-9_]{1,15}+']);
Route::get('cases/case_market/:id$','content/viewcase_market',[],['__url__'=>'cases\/case_market\/\d+$']);                                                                                              

你可能感兴趣的:(thinkphp5)