php laravel伪静态,phpStudy+nginx配置laravel伪静态

之前一直用宝塔配置环境,但是,最近宝塔win版本的停止更新了,只能用回phpstudy了,

记录一下配置伪静态

1:点击创建站点的时候,进行伪静态配置

80d27ecfb8692f9562f29f49b743b62f.png

在伪静态输入框中输入如下代码,并点击保存

# Check if a file exists, or route it to index.php.

try_files $uri $uri/ /exploit/index.php?$query_string;

if (!-e $request_filename) {

rewrite ^(.*)$ /index.php?s=$1 last;

break;

}

920db2818bf866bce534559b79645721.png

打开相应的配置文件,我现在配置的是localhost_80.conf

b67df1e017d6f93097af2417ee66c54b.png

3e4b307eb215923784e9550e5dc23f90.png

打开相应的站点跟目录可以看到在public下面会有个nginx.htaccess文件

0f1dfa038a509de56b72ef528f2ce7b5.png

server {

listen 80;

server_name dev.test.net;

root "E:/wwwroot/xxxx/public";

location / {

index index.php index.html error/index.html;

if (!-e $request_filename) {

rewrite ^(.*)$ /index.php?s=/$1 last;

break;

}

autoindex off;

}

location ~ \.php(.*)$ {

fastcgi_pass 127.0.0.1:9001;

fastcgi_index index.php;

fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

include fastcgi_params;

}

}

重启nginx查看效果

配置完成!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值