美文网首页
如何在项目中隐藏index.php

如何在项目中隐藏index.php

作者: 端木安玉 | 来源:发表于2019-07-16 16:05 被阅读0次

仅适用于Apache下面,如果你的Apache已经开启rewrite模块的话(大部分环境都已经开启),可以在.htaccess文件中添加下面代码:

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

亲测有效

相关文章

网友评论

      本文标题:如何在项目中隐藏index.php

      本文链接:https://www.haomeiwen.com/subject/pretlctx.html