Let's say i have this url:
http://mysharepoint.onprem.local/path1/path2/path3/path4
I need to be able to obtain all the sub-sites within the URL.
For example:
http://mysharepoint.onprem.local/path1/path2/path3/path4 is a site
http://mysharepoint.onprem.local/path1/path2/path3 is a site
http://mysharepoint.onprem.local/path1/path2 is not a site, just a context path.
http://mysharepoint.onprem.local/path1 is a site collection
Do I need to be able to back track through the url obtaining all the sub-sites? If so, given a URL, how can I determine if the URL is a sharepoint site or not?
Otherwise, what is a better way to do it?