Published: Friday, November 16th, 2007

The Problem

I've had this problem for a while, but it's become more of a problem since I started working heavily with CakePHP.

Here is my WAMP folder structure: D:\wamp\www\cake\[various app]

Under this folder, I would have baked all the different applications that I'm working on at the time (app1, app2, app3, etc). So I could have my DocumentRoot set to my cake folder and access the different apps in my browser by:

  • http://localhost/app1/
  • http://localhost/app2/
  • http://localhost/app3/

That's a perfectly fine idea, except that 95% of the time, when I deploy an application for a client it's going to be installed on their root directory of that domain name. Even on my server, all my applications (CakePHP and otherwise) have their own domain or sub domain.

If we keep everything to relative paths and stress using CakePHP's $html->url() function, then everything should be fine. But sometimes I'm lazy and I want to do a quick href=/ and not have to try to figure out how many levels I've gone. Also, I want to confidence to upload my entire folder to the clients server and only have to change database configurations.

If you're new here, you may want to subscribe to my Full RSS feed. Thanks for visiting!