InitPHP (A PHP Framework) 用户手册
第3章 3.3 路由
URL路由解析说明:
路由配置:
/**
 * 路由访问方式
 * 1. 如果为true 则开启path访问方式,否则关闭
 * 2. default:index.php?m=user&c=index&a=run
 * 3. rewrite:/user/index/run/?id=100
 * 4. path: /user/index/run/id/100
 * 5. html: user-index-run.htm?uid=100
 * 6. 开启PATH需要开启APACHE的rewrite模块,详细使用会在文档中体现
 */
$InitPHP_conf['isuri'] = 'rewrite';
Apache Rewrite:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
Nginx的话所有请求指到index.php入口文件上即可:
location / {


        root   /var/www/phpshuo.com/;
        index  index.html index.htm;

        if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
        }
        if (!-f $request_filename){
                rewrite (.*) /index.php;
        }


}