當前位置:首頁 » 編程語言 » 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;
}
}

熱點內容
ftp伺服器被動模式配置 發布:2025-07-04 05:17:32 瀏覽:331
電動車小龜有哪些配置 發布:2025-07-04 05:16:18 瀏覽:39
mysql同步存儲過程 發布:2025-07-04 05:14:32 瀏覽:662
安卓手機如何控制空調 發布:2025-07-04 05:09:06 瀏覽:154
新潔爾滅用於物體表面怎麼配置 發布:2025-07-04 05:03:28 瀏覽:829
生活中的雲伺服器 發布:2025-07-04 05:01:55 瀏覽:744
三星g6700c原始密碼是多少 發布:2025-07-04 04:49:41 瀏覽:726
網頁編程代碼 發布:2025-07-04 04:47:25 瀏覽:805
發消息時用到什麼密碼 發布:2025-07-04 04:41:47 瀏覽:980
3個密碼箱能裝多少錢 發布:2025-07-04 04:39:36 瀏覽:11