phpstudy nginx环境下,tp5.1重写规则

直接贴代码了。

server {
        listen       80;
        server_name  127.0.0.1;
        index  index.html index.htm index.php l.php;
        #charset koi8-r;


        #access_log  logs/host.access.log  main;
        root    "C:/sky/myphp_www/PHPTutorial/WWW/tp_push/public";
       # location / {
           # index  index.html index.htm index.php l.php;
          # autoindex  off;
       # }
        #URL重写
       location / { 
          if (!-e $request_filename) {
    rewrite  ^(.*)$  /index.php?s=/$1  last;
          }

       }



还有一种:



猜你喜欢

转载自blog.csdn.net/qq_31164125/article/details/80528141
今日推荐