比如在地址中输入
http://127.0.0.1/shop/index.php?act=show_groupbuy&op=index
和
http://127.0.0.1/index.php?act=show_groupbuy&op=index
是一样的
这说明去掉文件夹也可以,但是我读了一下控制器,没有发现替换的写法呢?
控制器如下
/** * 控制器调度 * */ private static function control() { //二级域名 if ($globals['setting_config']['enabled_subdomain'] == '1' && $_get['act'] == 'index' && $_get['op'] == 'index') { $store_id = subdomain(); if ($store_id > 0) $_get['act'] = 'show_store'; } $act_file = realpath(base_path . '/control/' . $_get['act'] . '.php'); $class_name = $_get['act'] . 'control'; if (!@include($act_file)) { if (c('debug')) { throw_exception("base error: access file isn't exists!"); } else { showmessage('抱歉!您访问的页面不存在', '', 'html', 'error'); } } if (class_exists($class_name)) { $main = new $class_name(); $function = $_get['op'] . 'op'; if (method_exists($main, $function)) { $main->$function(); } elseif (method_exists($main, 'indexop')) { $main->indexop(); } else { $error = "base error: function $function not in $class_name!"; throw_exception($error); } } else { $error = "base error: class $class_name isn't exists!"; throw_exception($error); } }
这是 url 重写造成的
也可能是你配置虚拟主机时未对主站做配置
这是 url 重写造成的
也可能是你配置虚拟主机时未对主站做配置
那你是真懂还是假懂?
路径不同就不可能解析到同一文件
如果 shop/index.php 和 admin/index.php 被解析到同一文件,那么要路径做什么?
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号