lenocin Posted December 7, 2009 Share Posted December 7, 2009 For some reason I just never had to bother with absolute paths. What I always did was create a "$level" variable at the top of each page, and set it according to the file's location ('' if in root, '../' if one level in, etc). Then I include files, css, etc by saying for instance "href=<?php echo($level); ?>css/main.css". Above worked just fine for me a very long time (bit clumpsy I agree). Lately I had to work with some code from others (and coincidently created on Mac, while I use Win) These code will use href="/css/main.css", which just does not work on my setup (manual AMPP installation) I read and looked into using <base>, but the only result and way to make absolute path's work, is if that site is directly in my root folder. (By the way, all of this apply to work locally). I use alias directories all over my computer (some work, some private) and set those in my http.conf with the alias directive. Anyone can educate me a bit here? Quote Link to comment Share on other sites More sharing options...
vinpkl Posted December 7, 2009 Share Posted December 7, 2009 absolute or relative paths works similar in windows and mac. Quote Link to comment Share on other sites More sharing options...
JustLikeIcarus Posted December 8, 2009 Share Posted December 8, 2009 What is the full url for the location of your css? 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.