rewrite - Nginx configuration Thinkphp plus .php
怪我咯
怪我咯 2017-05-16 17:16:55
0
1
415

The website is built using Thinkphp, and Nginx is used as the proxy server.

Nginx rewrite configuration is as follows:

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

Normal address:

http://aaa.com/api/home?id=1

You can also access it if you want to change it to the following (add .php suffix):

http://aaa.com/api/home.php?id=1

Please tell me how to configure Nginx?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
漂亮男人

Match the directory under the api:

rewrite /api/(.*)\.php /api/ permanent;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!