I need to replace the host part of the Uri
HttpContext.Current.Request.Url.Host = "newDomain";
you can’t set host. Is there a quick and easy way to do this to a Uri for reusing it to redirect somewhere else?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the
UriBuilderclass to change URIs, e.g.URIs are tricky little beasts with plenty of semantics you might not know or expect, so don’t go using string functions on them unless you absolutely have to.