• tp5中index.php的隐藏


    一,找到/public/.htaccess文件,如果你的入口文件已经移动到根目录下,那么你的.htaccess文件也要剪切到根目录下,总之要确保.htaccess跟入口的index.php保持同级。

    二,根据你的php环境分别设置.htaccess文件:

    Apache:

    复制代码
    <IfModule mod_rewrite.c>
    Options +FollowSymlinks -Multiviews
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    </IfModule>
    复制代码

    phpstudy:

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

    Nginx(在Nginx.conf中添加):

    复制代码
    location / { // …..省略部分代码
        if (!-e $request_filename) {
            rewrite  ^(.*)$  /index.php?s=/$1  last;
            break;
        }
    }
  • 相关阅读:
    问题 D: 错误探测
    问题 C: 计算矩阵边缘元素之和
    同行列对角线的格子
    矩形交换行
    问题 R: 鸡尾酒疗法
    问题 : 字符串p型编码
    循环结构 整数的个数
    字符串c++字符环
    ISBN码字符串c++
    Uva
  • 原文地址:https://www.cnblogs.com/sqsnbrdcwlcfzj/p/8810702.html
Copyright © 2020-2023  润新知