When accessing a page through a subdomain, all includes and relative paths break (even though the directory structure on the server should allow for the relative path to find it). What's the best way to have files on multiple subdomains access central resources (without using absolute paths)?
An JavaScript example:
m_url : '../code/php/UserAPI.php',
$.ajax({
url: someClass.m_url,
dataType: "json",
data: paras,
success: function(ret){someClass.onLoggedIn(ret, callback)}
});
if this UserAPI is called from subdomain1.example.com
and subdomain2.example.com
but the php resides on example.com
how can one make the relative path follow the linux directory structure instead of adding trying to concatenate the subdomain/domain path?
ps. The reason m_url can't be hard coded is because the code has to work on both development and production servers.
Thanks as always!!