My app is configured in startup to have a base path since the app is being reverse proxied.
app.UsePathBase("/myapp");
public IActionResult OnGet()
{
return Redirect("/en/");
}
However, when I visit the page, I get redirected to /en/
instead of /myapp/en/
How do I redirect while including the base path?
This can be accomplished by preceeding the path with a tilde in the Redirect
call.
public IActionResult OnGet()
{
return Redirect("~/en/");
}