TP5.1如何去除URl里面的(index.php)
例如:http://www.shopping.cn/index.php /admin/login.html
具体操作如下:
在public同级目录下 .hatccess 文件中编辑以下代码:
<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>
具体可关注 ThinkPHP5.1完全开发手册>>URL访问>>URL重写
注意要将’/‘换成’?’ 方可实现
实现结果如下