A way to get relative paths to work using subdomains?

symlustseque

New Member
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:\[code\]m_url : '../code/php/UserAPI.php', $.ajax({ url: someClass.m_url, dataType: "json", data: paras, success: function(ret){someClass.onLoggedIn(ret, callback)} });\[/code\]if this UserAPI is called from \[code\]subdomain1.example.com\[/code\] and \[code\]subdomain2.example.com\[/code\] but the php resides on \[code\]example.com\[/code\] 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!!
 
Back
Top