Getting a 404 error on files that exist.

Status
Not open for further replies.

warforge

New Member
Messages
2
Reaction score
0
Points
1
Currently on my site, I have a php script that grabs images/galleries from of my subreddit using JSON, inserts the info about the image into a database, creates the image or gallery a specific folder named after it, assigns the folder 755 CHMOD permissions, then copies the image and saves it in the correct folder. Although the view button in the cPanel File Manager works just fine, trying to access any of the images via that image's URL simply leaves me with a 404. any other images work just fine, as evident by the images linked in my CSS showing up. I have checked and double-checked spelling, slashes, capitalization, punctuation, and folders being where they should be. Everything seems to be in order. I have also tried (just to see if maybe something was getting corrupted during the copy process) deleting the image and manually uploading it. if I use a different name, it works. Using the same name does not work. I need these images to be named they way they are (0.jpg - x.jpg, depending on how many images are in the folder) for my slider system to work, so changing the naming scheme isn't really an option. Anyone got any ideas?
 

lingeri3

New Member
Messages
11
Reaction score
0
Points
1
Hi warforge,

I had the same problem and, in my opinion, it is caused by the Varnish cache: it seems that the server stores in the cache the file as not existent at the beginning then, passed 15 minutes, it updates the cache and the all start to work correcty again....

To disable the Varnish cache you have to add the following line to the .htaccess file:

#Disable the Varnish Cache
Header set Cache-Control "max-age=0, private, no-cache, no-store, must-revalidate"

but, even with this workaround, it is possible for the issue to be repeated at the first time the file is invoked if the Varnish service is faster than the Apache server in accessing the newly added file....

Regards.
 
Status
Not open for further replies.
Top