It looks like you really want to get the scheme, authority, and URI path.
You can use the Uri.GetComponents Method for this:
var uri = new Uri("http://blah/blah/?blah"); var result = uri.GetComponents( UriComponents.SchemeAndServer | UriComponents.Path, UriFormat.UriEscaped);
source share