Code前端首页关于Code前端联系我们

如何在Nginx环境下隐藏thinkphp5入口index.php?

terry 2年前 (2023-09-25) 阅读数 42 #后端开发

打开Nginx.conf。从它所在的目录。

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

PS:上面设置完后,需要将主页入口指向公共目录,否则无法使用。

版权声明

本文仅代表作者观点,不代表Code前端网立场。
本文系作者Code前端网发表,如需转载,请注明页面地址。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门