新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
THINKPHP5如何隱藏index.php
APACHE

成都創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)服務(wù)商,為中小企業(yè)提供成都網(wǎng)站制作、成都網(wǎng)站建設(shè)服務(wù),網(wǎng)站設(shè)計(jì),網(wǎng)站改版維護(hù)等一站式綜合服務(wù)型公司,專業(yè)打造企業(yè)形象網(wǎng)站,讓您在眾多競(jìng)爭(zhēng)對(duì)手中脫穎而出成都創(chuàng)新互聯(lián)公司。
找到/public/.htaccess文件,如果你的入口文件已經(jīng)移動(dòng)到根目錄下,那么你的.htaccess文件也要剪切到根目錄下,總之要確保.htaccess跟入口的index.php保持同級(jí)。
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
NGINGX
location / { // …..省略部分代碼
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
如果你的應(yīng)用安裝在二級(jí)目錄,Nginx的偽靜態(tài)方法設(shè)置如下,其中youdomain是所在的目錄名稱。
location /youdomain/ {
if (!-e $request_filename){
rewrite ^/youdomain/(.*)$ /youdomain/index.php?s=/$1 last;
}
} 分享文章:THINKPHP5如何隱藏index.php
文章鏈接:http://fisionsoft.com.cn/article/dhcdojo.html


咨詢
建站咨詢
