Home > PHP Framework > ThinkPHP > How to hide index.php in tp3.2.3

How to hide index.php in tp3.2.3

藏色散人
Release: 2023-01-13 00:40:31
Original
2175 people have browsed it

tp3.2.3隐藏index.php的方法:首先找到并打开“.htaccess”文件;然后修改内容为“RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]”即可。

How to hide index.php in tp3.2.3

本文操作环境:windows7系统、tp3.2.3版,DELL G3电脑

tp3.2.3如何隐藏index.php?

在.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

只需要改成这样(只有最后一行有所改变):

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

就可以达到隐藏index.php的效果

相关推荐:最新的10个thinkphp视频教程

The above is the detailed content of How to hide index.php in tp3.2.3. 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