title: How to get SPSite from a full page url
body: <p>I have a custom navigation menu for my <code>SharePoint intranet</code> web application which is composed of multiple site collections.  </p>
  
  <p>The navigation menu is organized differently from the underlying site collections 
  (ex. items from two different site collections are in the same navigation section). </p>
  
  <p>Now I need to add security so that menu items are hidden based on permissions.</p>
  
  <p>If one of the menu items has a full url of <code>"http://intranet.test.com/sites/Accounting/Pages/Welcome.aspx"</code> then is there a function that I could run from the <code>SharePoint object model</code> that would take that <code>url</code> and return an <code>SPSite</code> object for my site collection at <code>"http://intranet.test.com/sites/Accounting"</code>?</p>