Reputation: 36044
I just installed PHP for IIS7. I've set up a virtual directory to my project so that I can browse to http://localhost/myproj/index.php
When I browse to index.php, I get 404 errors for the javascript files that I want to include.
In index.php I'm including them like so:
<script language="javascript" type="text/javascript" src="/_inc/jquery.js"></script>
instead of looking for javascript file under my virtual directory, it tried to search it under root. http://localhost/_inc/jquery.js
Is there a way to make it look for includes under my virtual directory?
Upvotes: 0
Views: 663
Reputation: 131881
instead of looking for javascript file under my virtual directory, it tried to search it under root.
Because you're telling it to do so. When you define a path with leading slash /
, then it is always treated as absolute. The browser doesn't care about something like "virtual directories".
/myproj/_inc/jquery.js
Upvotes: 1