Html 为什么我在使用 img 标签时会收到 403 禁止?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7544048/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why am i getting a 403 forbidden when using a img tag?
提问by CodingIsAwesome
When trying to use
尝试使用时
<img src="../Ginger.jpeg" />
I am getting a 403 error.
我收到 403 错误。
Here is the page which is requesting:
这是请求的页面:
http://laponderosakennels.com/beagles/memories/ginger/index.html
http://laponderosakennels.com/beagles/memories/ginger/index.html
What is going on here am I just tired?
这是怎么回事我只是累了吗?
回答by Baz1nga
if you look at http://laponderosakennels.com/beagles/memories/Ginger.jpegit throws a 403 error.. there is a permission issue for the same.
如果您查看http://laponderosakennels.com/beagles/memories/Ginger.jpeg,它会引发 403 错误。同样存在权限问题。
The problem is probably cos you are referring to the wrong file.. i took the liberty of looking at your folder structure and you are referring to ginger.jpegwhich has a permission issue and there is a file ginger.jpgthat works fine.
问题可能是因为您指的是错误的文件。我冒昧地查看了您的文件夹结构,而您指的是存在权限问题的ginger.jpeg,并且有一个文件ginger.jpg可以正常工作。
Also make sure you refer to the file correctly.. i.e ginger.jpg
还要确保您正确引用了该文件.. 即 ginger.jpg
回答by Kc Gibson
This can also be caused by using hotlinking protection. So if hotlinking protection is used, make sure that the URL for your website is added to the white list. Also keep in mind that www.yourdomain.com and yourdomain.com are considered two different URLs.
这也可能是由于使用盗链保护造成的。因此,如果使用盗链保护,请确保将您网站的 URL 添加到白名单中。另请记住,www.yourdomain.com 和 yourdomain.com 被视为两个不同的 URL。
回答by ace
403 stands for permission denied. You need to check the permissions for "Ginger.jpeg".
403 代表权限被拒绝。您需要检查“Ginger.jpeg”的权限。