Home >Backend Development >PHP Problem >How to hide index.php on web pages

How to hide index.php on web pages

藏色散人
藏色散人Original
2022-01-06 09:15:033417browse

网页隐藏index.php的方法:1、找到网站的配置文件;2、添加“rewrite ^/(.*)$ /index.php/$1 last;”内容即可。

How to hide index.php on web pages

本文操作环境:Windows7系统、宝塔面板7.4.0版、Dell G3电脑。

网页怎么隐藏index.php?

服务端隐藏index.php的方法!!!宝塔面板

1.找到网站的配置文件

How to hide index.php on web pages

2.复制此代码即可

 location / {
       if (!-e $request_filename) {
            #一级目录
            rewrite ^/(.*)$ /index.php/$1 last;
        } 
    }

推荐学习:《PHP视频教程

The above is the detailed content of How to hide index.php on web pages. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn