Home  >  Article  >  Backend Development  >  Hidden entry files in TP5

Hidden entry files in TP5

不言
不言Original
2018-05-08 11:13:574246browse

这篇文章主要介绍了关于TP5中隐藏入口文件,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

使用phpstudy时
tp5中的官方说明是在入口文件的同级目录下添加一个.htaccess文件
文件内容:

<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下并没有效果
在phpstudy下.htaccess文件里面的内容应该改成:

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

相关推荐:

tp5中phpexcel生成表格实例分享


The above is the detailed content of Hidden entry files in TP5. 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