July 13, 2009
Reply :D

Reply :D

I got this question in an email today, and I thought it would be more fun to answer it on my blog instead of just telling the one person the answer. :D

I have a web design question. It’s a quick one, don’t worry. I am developing with XAMPP locally. I put the website files in a subdirectory off of the Apache document root. But what this means is that whenever I specify an absolute path on my webpages, like “/include/navbar.php”, it goes up to the localhost/ directory instead of the localhost/subdirectory/ directory. I’m thinking the solution would be to set up DNS, but this seems like something so simple. What do you do to get your absolute paths to work?

Unfortunately, as the title of this post suggests, it’s not possible. :P There’s no way to use absolute paths with a subdirectory without possibly breaking the code when you take it out of a testing environment and put it on a root directory. Of course, I too use subdirectories of my XAMPP root for website testing, so I had to figure out some workarounds. Continue reading Question: Access of root directory of a subdirectory »