I typically refer to any assets on my site using absolute path so that I don\'t have to worry about the location of the assets relative to current file.
<
EDIT:
Of course it would work in case you do with php. Adding:
define(_BASE_, substr($_SERVER['SERVER_NAME'] . "/" . $_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], "/" )) ); ?>