In my code, I'm trying to access the root path for the current site.
Let's say I'm accessing my website
Here is the site definition:
<site patch:before="site[@name='website']" name="SomeSite" hostName="mywebsite" rootPath="/sitecore/content/Somesite" startItem="/home" database="master" loginPage="/login" ... />
When I try to get the root path, all methods I've tried return
/sitecore/content. What I want to get is
/sitecore/content/Somesite, which is what I've specified on the site definition.
I tried the following:
foreach(var site in Sitecore.Configuration.Factory.GetSiteInfoList())
Is there something I'm missing, like passing the current hostname or something that can pick the complete root path?