View Full Version : image showing up problem

01-19-2008, 11:08 PM
Hello, when I view a certain image on my website, I get this message. "Forbidden
You don't have permission to access /images/adlogo.png on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

When I post my picture on another site that I have, I get a broken picture. Please help and thank you.

01-20-2008, 12:33 AM
Please post a link to the page on your site that contains the problematic code so we can check it out.

Sounds like a corrupt/legacy format image file. Possibly decent enough to be viewed in an image editor/viewer locally, but not for the browser, or damaged in transit (while uploading).

Depending upon your upload method, it could be an issue to do with permissions on the file and/or directory(ies) containing it. Most modern methods for uploading files deal with setting permissions automatically though.

01-20-2008, 03:30 AM
Well, http://www.athletes4excellence.com/images/adlogo.png that is the link. However, when I go to http://www.athletes4excellence.com/images/ and I click on "adlogo.png" I see it perfectly.

01-20-2008, 04:15 AM
Definitely not an issue with the image file's integrity. Probably the permissions on the folder and/or files (all the images in that folder that I checked behave the same way as your example image). it could be something else, like if you were messing around with an .htaccess file for that folder or the site. I cannot check out the permissions without the site's ftp address and ftp login information.

But, you should be able to check the permissions in your ftp program and compare them to other folders and images, and folders with images that work OK.

Do have any images on that domain that are problem free?

01-20-2008, 04:25 AM
Yes, like this one for example; http://www.athletes4excellence.com/sbi_header1.jpg . Also the image files have a premission/chmod of 644 and the image/ folder it self has a premission on 755.

01-20-2008, 05:21 AM
Oh really?

You don't have permission to access /sbi_header1.jpg on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

As long as the image is cached, or perhaps even loaded as a part of a page, it seems OK. I'm beginning to think that your server is simply denying raw requests for images. Many servers do this to conserve on bandwidth by refusing to allow remote requests for images (essentially not acting as an image host). As long as the image is a part of a page on the site on the same domain, it will be allowed, or if it has already been cached. If that's what is happening, I wouldn't worry about it. If you need the image hosted for other (off site) uses, put it on photobucket.com or another image hosting site.

This bit:

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

means that either the custom error file isn't where the server and/or browser expects it to be, or that the host will not allow a custom Forbidden, and/or custom 404, and/or other custom error document, and/or that you haven't configured it properly to do so.

01-20-2008, 07:05 AM
So I should just ignore that 404? Also, if I just wanted to use my website instead of something like photobucket, how would I fix the problem. Please and thank you!

01-20-2008, 10:37 AM
If the 404 is only the result of attempted 'hotlinking', I would generally ignore it, yes.

For more information on 'hotlinking', do a search, or see:


and select the Disable Hotlinking tab. This explains how to use .htaccess to disable hotlinking. There are other ways to disable it. To reverse it, one would need to know how the server is disabling it and remove that from the server, or from its configuration. If you do not own your server, you may have to request this ban be lifted for your account, or it may be in your account's online configuration area (if it has one). Your host may simply not allow hotlinking, in which case you would need to get another host that does allow it.

Or, as I said before, you could use an image hosting site.

01-21-2008, 01:38 AM
Well, I own the server my self. Is it in the WHM? Please and thank you.

01-21-2008, 03:14 AM
Could be. I don't own any servers, so I'm not familiar with their configuration. I assume that of the various types of servers, particularly their OS's, it varies.

I'd look over the documentation. If you are lucky, there will be something on linking or even hotlinking that will explain how to set things in order to disallow/allow it. It could be something else, but it seems very likely that it is a setting as regards hotlinking (although the server may call it something else) that is preventing you from linking directly to the images.

If you have an .htaccess file, it may even be in there.

01-21-2008, 03:28 AM
Thanks you!

01-21-2008, 04:20 AM
The image issue does seem to be one from a hotlinking perspective. This would be fixed in CPanel, not WHM (unless the newer version has some major tweaks).

As for the error code, John, that is the new defacto 404 error code. They just assume that you have a custom Error Document request.

To set one up afe... create a page you want to show as your 404 error page. Upload it into the root folder and name it 404.shtml. then in your .htaccess add these lines:

ErrorDocument 401 /401.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 403 /403.shtml

Repeat the making of pages for 401 and 403 (401 is username password is wrong, and 403 is forbidden access).

That should fix that problem.

01-21-2008, 04:37 AM
Thanks! However, I added a .htaccess on to that /image folder with the code "## DISABLE HOTLINKING
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?tnfnorth.proboards70.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?alanawez.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?speedsoles.net/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|js|css)$ - [F]

Would that work? Please and thank you.

01-21-2008, 04:47 AM
Looks right to me. Although I am not a ReWrite guru.

01-21-2008, 04:50 AM