TP5如何隱藏入口檔案index.php
一、Apache 在ThinkPHP5.0中,出於優化的URL訪問原則,還支援通過URL重寫隱藏入口檔案,下面以Apache為例說明隱藏應用入口檔案index.php的設定。 下面是Apache的配置過程,可以參考下: 1、httpd.conf配置檔案中載入了mod_rewrite.so模組 2、AllowOverride None 將None改為 All 3、在應用入口檔案同級目錄新增.htaccess檔案,內容如下: Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]//---------------此處與官網不同; 4、重啟Apche; 二、Nginx 開啟nginx配置檔案 [