6.URL说明
LMLPHP支持PATH_INFO,参数模式,普通模式三种URL模式,优先级从前到后。三种方式都分别拥有各自的rewrite模式。下面对这三种方式逐一进行分解:
PATH_INFO模式 (LMLPHP在PATH_INFO不存在时,通过SCRIPT_URI获取PATH_INFO,因此在服务器不提供PATH_INFO时也可使用)
参数模式 (LMLPHP默认的rewrite规则只去除入口文件,如果更改rewrite规则可以达到和PATH_INFO一样的效果)
普通模式
PATH_INFO模式 (LMLPHP在PATH_INFO不存在时,通过SCRIPT_URI获取PATH_INFO,因此在服务器不提供PATH_INFO时也可使用)
URL | Module | Action |
---|---|---|
http://www.domain.com/index.php/ | ModuleIndex | index |
http://www.domain.com/index.php/Article | ModuleArticle | index |
http://www.domain.com/index.php/Article/newest | ModuleArticle | newest |
对应rewrite模式如下: | ||
http://www.domain.com/ | ModuleIndex | index |
http://www.domain.com/Article | ModuleArticle | index |
http://www.domain.com/Article/newest | ModuleArticle | newest |
参数模式 (LMLPHP默认的rewrite规则只去除入口文件,如果更改rewrite规则可以达到和PATH_INFO一样的效果)
URL | Module | Action |
---|---|---|
http://www.domain.com/index.php?path=/ | ModuleIndex | index |
http://www.domain.com/index.php?path=/Article | ModuleArticle | index |
http://www.domain.com/index.php?path=/Article/newest | ModuleArticle | newest |
对应rewrite模式如下: | ||
http://www.domain.com/?path=/ | ModuleIndex | index |
http://www.domain.com/?path=/Article | ModuleArticle | index |
http://www.domain.com/?path=/Article/newest | ModuleArticle | newest |
普通模式
URL | Module | Action |
---|---|---|
http://www.domain.com/index.php | ModuleIndex | index |
http://www.domain.com/index.php?m=Article | ModuleArticle | index |
http://www.domain.com/index.php?m=Article&a=newest | ModuleArticle | newest |
对应rewrite模式如下: | ||
http://www.domain.com/ | ModuleIndex | index |
http://www.domain.com/?m=Article | ModuleArticle | index |
http://www.domain.com/?m=Article&a=newest | ModuleArticle | newest |