When I upload files to my staging server (CentOS 6.5, Apache 2.2.26) - such as images or PDFs - via FTP, or by using a file upload script I created (using Laravel 4), they 404 even though they exist.
However, any files that are pulled via git are fine.
I took a look at the difference between ownership of a normally loading file and a 404ing file. When uploaded via FTP or the site, the owner:group is
mobius:mobius. When pulled by git, it's
When I run
chown -R 0:0 assets/, any files that previously returned 404 loaded perfectly. However, since the site has an upload feature it would be impractical to have to keep executing this command.
How can I make the server show the file no matter who the owner?
chmod won't work on its own.
I don't think it's a problem with my
.htaccess because I deleted it and still got a 404.
Edit: It's worth noting that I can access the file using the absolute URL (i.e., not a subdomain)