Correct way to do a Response.Redirect from one page to another on the same site
asp.net, c#, request
Solution
Use application relative urls. `~/` represents the application root path, so it will work for both `/` and `/virtual-directory/`.
Response.Redirect("~/testing.aspx");
Problem
I'm sure this has been asked time and time again. And yes I've searched. However, I'm unable to find an example that clearly demonstrates what I'm looking to accomplish. I'm currently on `mywebsite/test.aspx`, I want to Redirect to `mywebsite/testing.aspx`. However I want this redirect to work both live on server and within debug of visual studio. I've tried ``` Response.Redirect(Request.RawUrl.Replace(Request.RawUrl,"testing.aspx")) ``` However this replaces the whole thing. Hope this makes sense - `mywebsite/test.aspx` should redirect to `mywebsite/testing.aspx`