[英]Image doesn't load from wwwroot if I'm using path base
我的應用程序托管在:
hxxps://myserver(dot)com/
我在wwwroot/images/picture.jpg
我正在使用app.UsePathBase("appPrefix")
現在我在.cshtml
文件中使用<img src="/images/picture.jpg />
問題是圖像實際上位於
hxxps://myserver(dot)com/appPrefix/images/picture.jpg
但img
試圖從hxxps://myserver(dot)com/images/picture.jpg
獲取它
那么,我怎么能告訴(可能)ViewEngine他應該尊重PathBase
?
一個選項可能是將<base href="/appPrefix"/>
到head-section中的_Layout.cshtml文件中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.