Issue
I have the following directory structure:
var/www/example.com/public_html/index.html var/www/example.com/public_html/images/example.jpg var/www/example.com/public_html/javascript/example.js
I ran the following file and directory permissions command:
chmod -R 755 var/www/example.com/public_html
So, all of the above files have 755
permissions, i.e. -rwxr-xr-x
(I've confirmed this via FileZilla).
From my browser I can navigate to index.html
and to example.jpg
. However, when I navigate to example.js
, I get a 404 error).
The way I discovered this was that my index.html
wasn't executing javascript. So index.html
can't see example.js
either.
What could be causing this?
Update: On localhost, index.html executes the javascript file fine. All this is happening on the remote server.
[SOLVED] -- after following this comment below, File permissions for a JavaScript file it still didn't work. I think the server wasn't updating / refreshing properly for some reason. So I then changed the name of the javascript folder to js, and updated index.html accordingly, and then miraculously everything worked.
Solution
After following this comment: File permissions for a JavaScript file it still didn't work. I think the server wasn't updating / refreshing properly for some reason. So I then changed the name of the javascript folder to js, and updated index.html accordingly, and then miraculously everything worked.
(I'll mark this as the correct answer when StackOverflow lets me.)
Answered By - thanks_in_advance Answer Checked By - David Goodson (WPSolving Volunteer)