ThinkPHP3.2.3+Nginx URL设置省略Index.php

2026-02-13 14:50:46

1、打开config.php,配置URL_MODEL=2项(伪静态模式);

ThinkPHP3.2.3+Nginx URL设置省略Index.php

2、打开Nginx.conf;配置规则:

location /{            if (!-e $request_filename) {                rewrite ^/(.*)$ /index.php?s=$1 last;                break;            }    }  

备注:该配置项放置在server{}里边;

ThinkPHP3.2.3+Nginx URL设置省略Index.php

3、重启Nginx;

ThinkPHP3.2.3+Nginx URL设置省略Index.php

4、省略index.php入口文件访问项目;

伪静态省略index.php设置成功!

ThinkPHP3.2.3+Nginx URL设置省略Index.php

猜你喜欢