I’m currently developing a reasonably complex HTML5 application. Up to now, I’ve been testing just by launching the HTML file directly from my file system, no server involved. However, I now need to use localStorage and, as has been previously discussed on StackOverflow, localStorage won’t persist in that environment, so I now have to introduce a host server of some sort.
I set up Apache 2.2.17, configured to function as localhost. I configured DocumentRoot to be the directory containing my HTML file (the file simply named as index.html) so I can now access the page as http://localhost/index.html. I’ve confirmed that localStorage will persist appropriately in this setup.
However, I’m running into a very serious problem that would render the site unusable by pretty much anyone other than a developer. Much of my layout depends on a custom jQueryUI theme, which I access in <head> as follows:
<link rel="stylesheet" href="themes/custom-theme/jquery-ui-1.8.6.custom.css/">
This relative path was working perfectly when I launched the HTML file directly from my file system. Apache, however, seems not to find it. According to Firebug, it is returning:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head></body>
<h1>Not Found</h1>
<p>The requested URL /themes/custom-theme/jquery-ui-1.8.6.custom.css/ was not found on this server.<p>
</body></html>
Any idea what gives? I can’t think of any reason why a relative path would behave differently under Apache than when I use it straight from the file system, and clearly it is in a subdirectory of my DocumentRoot, so I would expect it to be accessible to the Apache server.
Any clues?
FWIW, I’m a very experienced programmer, but a newbie at setting up Apache. If there are other configuration options I should be playing with, the odds are I am not familiar with them.
what if you remove the last “/” from your CSS URL :
(you’re currently trying to access “jquery-ui-1.8.6.custom.css” as a directory…)