diff --git a/application/config.php b/application/config.php index 25d573c..53fc153 100644 --- a/application/config.php +++ b/application/config.php @@ -95,7 +95,7 @@ return [ // 是否开启路由解析缓存 'route_check_cache' => false, // 是否强制使用路由 - 'url_route_must' => false, + 'url_route_must' => true, // 域名部署 'url_domain_deploy' => false, // 域名根,如thinkphp.cn diff --git a/application/route.php b/application/route.php index 289b1e6..efae612 100644 --- a/application/route.php +++ b/application/route.php @@ -13,7 +13,7 @@ use think\Route; // ################################################################下载################################################################ // ################################################################下载################################################################ -Route::get('/download', 'admin/download/demo'); +Route::get('download', 'admin/download/demo'); // ################################################################管理后台################################################################ // ################################################################管理后台################################################################ @@ -34,8 +34,8 @@ Route::get('/download', 'admin/download/demo'); // ################################################################APP接口################################################################ // ################################################################APP接口################################################################ -// // 处理404错误 z -// Route::miss(function(){ -// return '404 Not Found'; -// // 或者你可以重定向到一个错误页面,或者进行其他处理 -// }); +// 处理404错误 z +Route::miss(function(){ + return '404 Not Found'; + // 或者你可以重定向到一个错误页面,或者进行其他处理 +});