不懂怎麼描述,因為tp5是指向public目錄的,本地可以直接指向,但是我在上傳到伺服器上的時候發現并不能打開。
找了許久才找到怎麼搞定,好了,直接上代碼
1.首先把/public目錄下的.htaccess,index.php和favicon.ico移到外層,也就是與app同級目錄下
2.修改index.php
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
//改成以下
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/start.php';
3.把html裡的css,js和img的路徑前添加/public/static/index
至此就可以搞定了。直接指向網站目錄就可以了,無須指向網站目錄下的/public