TP5隱藏url中的index.php


public文件夾下,有個.htacess文件,沒有則新建一個, 如果已有這個文件,原文件內容如下:

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


如果此時還是報錯 : “No input file specified.”;

 

那么就重寫規則把最后一行

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] 

改為

RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L] 

即可!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM