MasterMayhem
New Member
I have the following in my code behind in C# which gets the filtered URL without http or https or www. So when the user tries to save www.testwww.com in the URL textbox then it should only strip out the www and save it as testwww.com. So I used the uri method. But it gives me some security warning error when I try to save my own host URL. So how to get past that? \[code\] private string GetFilteredUrl_new(string url) { Uri uri = new UriBuilder(url).Uri; // defaults to http:// if missing string lowerCaseUrl = Regex.Replace(uri.Host, "^www.", ""); //To maintain the user input case, we need to use the original URL return url.Substring(url.Length - lowerCaseUrl.Length, lowerCaseUrl.Length); }\[/code\]