在phpstudy集成环境中nginx服务器如何配置url重写

这篇文章主要介绍了在phpstudy集成环境中nginx服务器如何配置url重写,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

直接在对应的vhosts.conf配置文件的location / {}中添加以下内容:

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

具体操作过程如下:

1、找到对应的vhosts.conf配置文件

在phpstudy集成环境中nginx服务器如何配置url重写

2、选择所需要配置重写url的站点

在phpstudy集成环境中nginx服务器如何配置url重写

感谢你能够认真阅读完这篇文章,希望小编分享的“在phpstudy集成环境中nginx服务器如何配置url重写”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注行业资讯频道,更多相关知识等着你来学习!