隐藏tp中的index.php

在config文件中添加以下配置:

(application/common/conf/config.php)

'URL_CASE_INSENSITIVE' => true,

//REWRITE模式

'URL_MODEL' => 2,

根目录.htaccess如果没有自己建也可以

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



Barley博客
  • 最新评论
  • 总共0条评论