search

Home  >  Q&A  >  body text

nginx pseudo-static replacement character rewrite writing problem

The url is
http://aaa.com/xxxx
or http://aaa.com/xxxx?id=bbb
How to write the configuration file to rewrite to
http:/ /aaa.com/index.php?p=xxxx
or http://aaa.com/index.php?p=xxxx&id=bbb

大家讲道理大家讲道理2751 days ago749

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 17:18:31

    You can refer to:
    Source of information

    location / {
                    .........
                    ##如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
                    if (!-e $request_filename)
                    {
                            rewrite ^/PHPParser/(.*)$ /PHPParser/index.php?s= last;
                            break;
                    }
            }
    

    reply
    0
  • Cancelreply