I have wamp setup on my windows box. Generally, when I bring a site down from the web, I create a folder inside my www folder for the site name. ex: c:\wamp\www\mysite. Once I have the folder, I copy down all the live files. The issue is that all the paths are then broken because my local folder isn’t rooted.
What is the best way to setup paths so that if the site moves to a folder that isn’t rooted, it will work easily?
I use a file (usually called something like
config.php) to keep track of the root folder. My definitions (constants) look like this:And then when you need to include a file
This would be something you do on a new site or if you have time to refactor your current site.