Home > Backend Development > PHP Problem > How to hide index.php in t3

How to hide index.php in t3

藏色散人
Release: 2023-03-10 07:58:01
Original
1825 people have browsed it

t3隐藏index.php的方法:首先修改配置文件;然后在根目录新建.htaccess文件;最后输入内容“RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]...”并保存即可。

How to hide index.php in t3

本文操作环境:windows7系统、thinkphp v3.2版,DELL G3电脑

thinkphp3 隐藏index.php

首先修改配置文件:

'URL_CASE_INSENSITIVE' => true, // 默认false 表示URL区分大小写 true则表示不区分大小写
'URL_MODEL' => 2, // URL访问模式,可选参数0、1、2、3,代表以下四种模式:
// 0 (普通模式); 1 (PATHINFO 模式); 2 (REWRITE 模式); 3 (兼容模式) 默认为PATHINFO 模式
Copy after login

Apache

在根目录新建.htaccess文件:

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
Copy after login

 

注意:尽管这样配置了,但是直接访问域名时还是会出现新建站点的界面,这时要检查根目录下是否有Index.html,去掉就可以了

推荐学习:《PHP视频教程

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template