/// <summary>
    /// Returns the permanent redirect response and interrupts the execution of current request.
    /// </summary>
    public static void RedirectToRoutePermanent(this IDotvvmRequestContext context, string routeName, object newRouteValues = null, bool replaceInHistory = false, bool allowSpaRedirect = true)
    {
        var route = context.Configuration.RouteTable[routeName];
        var url   = route.BuildUrl(context.Parameters, newRouteValues);

        context.RedirectToUrlPermanent(url, replaceInHistory, allowSpaRedirect);
    }