title: A way to get relative paths to work using subdomains?
body: <p>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)?</p>
  
  <p>An JavaScript example:</p>
  
  <pre><code>m_url : '../code/php/UserAPI.php',
  
      $.ajax({
          url: someClass.m_url,
          dataType: "json",
          data: paras,
          success: function(ret){someClass.onLoggedIn(ret, callback)}
      });
  </code></pre>
  
  <p>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?  </p>
  
  <p>ps. The reason m_url can't be hard coded is because the code has to work on both development and production servers.</p>
  
  <p>Thanks as always!!</p>