TP5中隱藏入口文件的問題 - CSDN博客


使用phpstudy和linux部署的時候 
tp5中的官方說明是在入口文件的同級目錄下添加一個.htaccess文件 
文件內容如下:

<IfModule mod_rewrite.c>Options +FollowSymlinks -MultiviewsRewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]</IfModule>
  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

這個配置在phpstudy和linux下並沒有效果 
如果是在phpstudy和linux下面.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>
  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

           


免責聲明!

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



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