ThinkPHP 下如何隐藏index.php

当时忘了是Tinkphp的URL重写模式:以后遇到相同问题,首先要想到URL重写模式。

  1. httpd.conf配置文件中加载了mod_rewrite.so模块
  2. AllowOverride None 将None改为 All
  3. 把下面的内容保存为.htaccess文件放到应用入口文件的同级目录下 

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond $1 !^(DATA|images|otherThings)
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>

猜你喜欢

转载自blog.csdn.net/macrohui29/article/details/86560233