When I create a new Netbeans project, it's Properties > Source section of the dialog box will show my web root
. For example, when I create an application called 'myApp', NetBeans Properties dialog box would show:
Project Folder: C:\xampp\htdocs\myApp
Source Folder: C:\xampp\htdocs\myApp
Web Root: <Source Folder>
Let's say that C:\xampp\htdocs\myApp has a _css subfolder where I store my CSS files. When I try to provide an ABSOLUTE path in my page like this:
<link rel="stylesheet" href="/_css/main.css
Netbeans reports an error:
Failed to load resource: the server responded with a status of 404 (Not Found) (10:41:10:815 | error, network)
Notice above that Apache now thinks my web root is C:/xampp/htdocs instead of C:/xampp/htdocs/myApp. In other words, the '/' somehow is pointing to C:/xampp/htdocs instead of the web root I specified in Netbeans (which is C:/xampp/htdocs/myApp).
Has anyone encountered this problem? And if so, how does a Netbean user make the '/' correctly point to the application web root? Someone has suggested altering the Apache configuration files to point to the appropriate application root, but that would throw off all other applications I create under C:/xampp/htdocs.