以下のコードのすべてがうまく機能します。ログが記録されます。しかし、リダイレクトは決して起こりません....
if (HttpContext.Current.Request.Url.Host.ToLower().Trim() == "mydomain.com")
{
if (!HttpContext.Current.Request.IsSecureConnection)
{
LogThis.WriteLog("redirecting");
HttpContext.Current.Response.Redirect(
string.Concat("https://mydomain.com", Request.RawUrl));
HttpContext.Current.Response.End();
}
}
何か案は?これはすべて、global.asax の Application_BeginRequest で行われます。タグ内のインラインコードです。コードビハインドはまったくありません。