midi_mick Posted March 21, 2007 Share Posted March 21, 2007 This is my 1st attempt at apache. I have just downloaded and installed WAMPP, and am having problems with relative paths in my documents. I use a commercial host for my published pages, but thought a local apache would help me with development and debug. I have set up a sub-directory under my DirectoryRoot for each website I am maintaining. However, relative links within the pages are not working correctly. Two examples (each a bit different, but showing the same symptoms): 1. I have a css file in folder site/css. The main page inli references "css/site.css". This is fine. However, in the css file is a url(../images/back.jpg) definition. Apache tries to find this file in "DocumentRoot/images" rather than in "DocumentRoot/site/images", where it actually resides. 2. Using Prototye for Ajax access gives me a similar problem. When I attempt to access data from the relative directory "scripts/program.php", it tries to find "DocumentRoot/scripts/program.php", instead of "DocumentRoot/site/scripts/program.php" I have also tried all this setting by up an Alias for "site", but the results are the same. Any ideas what I am missing in the config? Thanks for any help. Mick [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
steviewdr Posted March 22, 2007 Share Posted March 22, 2007 Copy/Move your test dir, so that it will be under: DocumentRoot "C:/Program Files/xampp/htdocs" Then try and see. Using an alias is not the "proper" method of enabling a website. Vhosts are specifically for that. Also - there are a LOT of includes in your httpd.conf, such as: # XAMPP specific settings Include conf/extra/httpd-xampp.conf G'Luck, -steve Quote Link to comment Share on other sites More sharing options...
midi_mick Posted March 22, 2007 Author Share Posted March 22, 2007 Thank you Steve. I have just found that to be the solution - setting up virtual hosts, and how to do it on http://www.activsoftware.com/apache/virtualhosts.cfm. Just about to test it all out, but I would say that this will fix. I will consider this thread now solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.