【问题标题】:Image not loading in page on WAMP localhost 403 forbidden error, but clicking its link works图像未在 WAMP localhost 403 禁止错误的页面中加载,但单击其链接有效
【发布时间】:2021-09-04 19:52:57
【问题描述】:

我在 WAMP 的 localhost 项目中有以下代码

<img src="/imgs/quickstartVideo.jpg" width="357" height="200" alt="quick start video">

图像不会出现 - 控制台显示“403(禁止)”。但是,如果我右键单击查看页面源,然后单击图像的链接,图像就会出现。

页面加载使用相同类型相对 URL 的 js 和 css 文件。

为什么它告诉我这是被禁止的,但当我点击它时却让我加载它?请问如何让它加载?

我的目录结构是:

c:\wamp
c:\wamp\www
c:\wamp\www\imgs
c:\wamp\www\js (js files are loading fine)

更新:它在 MS Edge 中正确显示,但不是 Chrome。

谢谢

【问题讨论】:

    标签: image localhost wamp


    【解决方案1】:

    已解决 - 问题是我在 htaccess 中设置的 IfModule mod_rewrite 以停止我的生产域上的图像热链接。为 localhost 开发评论了它,而且,有趣的是,我的图像又可以工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-20
      • 2018-12-08
      • 2020-03-16
      • 2014-10-01
      • 2013-09-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多