title: What exactly is a baseUrl
body: <p>I have spent sometime trying to understand what a baseUrl is(from learning Zend Framework), but it's surprising that for such a ubiquitous utility, not a single "expert" or blogger has even attempted to define baseUrl so that a learner has an idea what it is about. They all assume you know what it is and then proceed to derive it, each one employing his own method to arrive at his own result. From what I'd read so far:  </p>
  
  <p>Some think it is a Homepage-Url, which is what I'd naturally think it is(as implied from the name), to be accessed by <code>$_SERVER["HTTP_HOST"]</code> or <code>$_SERVER["SERVER_NAME"]</code> but surprisingly these seem to be in the minority.</p>
  
  <p>Some think it is a current page to be accessed by <code>$_SERVER["REQUEST_URI"]</code> or <code>$_SERVER["PHP_SELF"]</code> appended to server-name</p>
  
  <p>while others think it can be any of the above or any url for that matter(well, at least that's the impression I get), depending on how the user wants to use it.</p>
  
  <p>So can someone please explain exactly what a baseUrl is, without assuming I'm also "expert" and why I might need it. Thank you.</p>
  
  <p><strong>EDIT:</strong> The baseUrl is supposed to be automatically set on most Zend projects, but apparently not in my case. Even when I do an <code>echo $this-&gt;baseUrl()</code> or <code>var_dump($this-&gt;baseUrl())</code>, I get nothing. So I really have no idea what this utility is about.</p>