thinkphp5.1隱藏入口文件

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章