phpstudy本地域名伪静态

发布时间 2023-10-07 10:18:41作者: 君乐豹

环境:WNMP(Windows10 + Nginx1.15.11 + MySQL5.7.26 + 【PHP 7.4.3 (cli) (built: Feb 18 2020 17:29:57) ( NTS Visual C++ 2017 x64 ) 】)

使用PhpStudy配置本地域名后,设置伪静态,这样在Web端打开网站就不需要输入index.php了,很简单,在php端设置

对了,我用的框架是ThinkPhp5,入口文件在public中。

 

输入的内容如下:

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

  就可以了

 其他环境参考:https://www.jianshu.com/p/380625ecd01a?tdsourcetag=s_pctim_aiomsg