當前位置:首頁 » 編程語言 » thinkphp隱藏indexphp

thinkphp隱藏indexphp

發布時間: 2023-09-26 06:26:55

㈠ tp5框架index.php入口文件隱藏

一,找到/public/.htaccess文件,如果你的入口文件已經移動到根目錄下,那麼你的.htaccess文件也要剪切到根目錄下,總之要確保.htaccess跟入口的index.php保持同級。
二,根據你的php環境分別設置.htaccess文件:
Apache:
<IfMole mod_rewrite.c>Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]</IfMole>

phpstudy:
<IfMole mod_rewrite.c> Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfMole>
Nginx(在Nginx.conf中添加):
location / { // …..省略部分代碼
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}

熱點內容
linux怎麼編譯c文件 發布:2025-09-18 09:55:16 瀏覽:301
python安裝後無法運行 發布:2025-09-18 09:45:57 瀏覽:236
安卓手機怎麼剪輯音樂 發布:2025-09-18 09:44:16 瀏覽:781
伺服器地址修改在哪找 發布:2025-09-18 09:42:41 瀏覽:441
sntp伺服器地址 發布:2025-09-18 09:28:36 瀏覽:552
phpunit 發布:2025-09-18 09:25:19 瀏覽:571
怎麼改伺服器的ip地址嗎 發布:2025-09-18 09:24:33 瀏覽:12
編譯703n固件 發布:2025-09-18 08:50:59 瀏覽:539
三星手機系統文件夾是哪個文件夾 發布:2025-09-18 08:48:45 瀏覽:284
rmijava 發布:2025-09-18 08:38:26 瀏覽:22