ASP.Net を使用して、HttpContext.Current.RewritePath を使用して別のドメインに書き換えることは可能ですか? 例えば。
HttpContext.Current.RewritePath("http://www.otherdomain.com");
これを試すと、次の例外が発生します。
「http://www.otherdomain.com」は有効な仮想パスではありません
ASP.Net を使用して、HttpContext.Current.RewritePath を使用して別のドメインに書き換えることは可能ですか? 例えば。
HttpContext.Current.RewritePath("http://www.otherdomain.com");
これを試すと、次の例外が発生します。
「http://www.otherdomain.com」は有効な仮想パスではありません
HttpContext.Current.RewritePath
サーバー側でのurlの書き換えです。
これは、URL を要求する場合、次を使用し/products
て asp.net に rednder を指示できることを意味します。/Products.aspx
if( HttpContext.Current.Request.RawUrl == "/products")
HttpContext.Current.RewritePath("/Products.aspx");
ユーザーを別のドメインに送信する場合は、次のことを行う必要があります。
HttpContext.Current.Response.Redirect("http://www.otherdomain.com/page");