ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
#### 一、伪静态模式 > 配置文件 > ├─data 配置文件 > │ ├─route.php 路由配置文件 > 'PATH_INFO'=>2,//URL模式 默认1 1、普通模式 2、伪静态模式 3、兼容模式 4、自定义路由模式 ~~~ http://www.calf.com/index.php/app/index/index/id/1 http://serverName/index.php/module/controller/action/param/value/.. ~~~ | 参数 | 名称 | | --- | --- | | module | 模块名 | | controller | 控制器名 | | action | 方法名 | | param | 参数名 | | value | 参数值 | #### nginx伪静态配置 ~~~ server { listen 80; server_name www.vc.cn; index index.php; root /data/wwwroot/vc; #error_page 404 /404.html; location / { index index.php; #calfbb REWRITE支持 if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?s=$1 last; } #301 跳转设置 if ($host = 'vc.cn') { rewrite ^/(.*) http://www.vc.cn/$1 permanent; } } location ~ [^/]\.php(/|$) { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } access_log /home/wwwlogs/vc.log access; } ~~~ 注意:如果nginx只配置 rewrite ^/(.*)$ /index.php?s=$1 last; 这一段,不配置下面静态资源,有可能找不到静态资源 #### apache伪静态配置可以从百度搜一下