美文网首页
thinkphp5隐藏public/index.php

thinkphp5隐藏public/index.php

作者: 原来是红灯啊 | 来源:发表于2019-04-19 09:59 被阅读0次

    1、建立.htaccess文件,最好不要把public/index.php中的index.php移出public文件夹下,以免后期升级tp5核心框架时出现错误
    2、写入一下代码

    <IfModule mod_rewrite.c>
    Options +FollowSymlinks -Multiviews
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
    </IfModule>
    

    相关文章

      网友评论

          本文标题:thinkphp5隐藏public/index.php

          本文链接:https://www.haomeiwen.com/subject/lrnfgqtx.html