我正在為 Web 應(yīng)用程序構(gòu)建管理界面。完整的目錄結(jié)構(gòu)如下:|-main| |- app| |- bootstrap| |- config| |- database| |- resources| | -views| |-admin| |-templates| |-template.blade.php| |-utils| |-foot.blade.php| |-head.blade.php| |-views| |-index.blade.php| |-users.blade.php| |- routes| |- web.php||-public_html| |-admindash| |-dist| |-css| |-img| |-js| |-plugins| |-bootstrap| |-fontawesome-free| |-jqueryhead.blade 文件看起來與此類似:<!DOCTYPE html><html><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>...</title> <!-- Font Awesome Icons --> <link rel="stylesheet" href="../admindash/plugins/fontawesome-free/css/all.min.css">..some more css here..</head><body class="hold-transition sidebar-mini">腳.刀片:<script src="../admindash/plugins/jquery/jquery.min.js"></script><!-- Bootstrap 4 --><script ...More scripts here...</body></html>
1 回答

幕布斯6054654
TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超7個(gè)贊
問題是您正在使用Relative URL。您需要使用Full URL而不是Relative。而且您正在接近錯(cuò)誤的方式在Shared Hosting中部署您的 laravel 。
解決方案
只需為所有文件css
和文件提供完整的網(wǎng)址js
,如下所示,
<link rel="stylesheet" href="http://www.yourdomain.com/admindash/plugins/fontawesome-free/css/all.min.css">
最佳實(shí)踐(共享主機(jī))
將 laravel
public
目錄更改為public_html
. (參考這里)使用
url()
或URL::assert()
函數(shù)生成斷言/完整 URL(請(qǐng)參閱此處)
- 1 回答
- 0 關(guān)注
- 81 瀏覽
添加回答
舉報(bào)
0/150
提交
取消