How to hide the entry path in php

藏色散人
Release: 2023-03-17 09:46:02
Original
1520 people have browsed it

php隐藏入口路径的方法:1、找到public下面的“.htaccess”文件;2、修改内容为“  Options+FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f”即可。

How to hide the entry path in php

本教程操作环境:windows7系统、thinkphp v5版、Dell G3电脑。

php 怎么隐藏入口路径?

TP5隐藏index.php

tp5对URL简化,不做简化情况下我们访问的是localhost/index.php/index/index/index ,做简化后省去index.php。

我们需要找到public下面的.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>
Copy after login

推荐学习:《PHP视频教程

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

Related labels:
php
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!