2009-12-04から1日間の記事一覧
http://example.jp/default.aspx や http://example.jp/index.htm を、 http://example.jp/ にRedirectする方法。以下はweb.configで「/index.aspx」を「/」にRedirectする例。 <system.webServer> <rewrite> <rule name="root_slash" stopProcessing="false"> <match url="^index\.aspx$"/> </match></rule></rewrite></system.webserver>
ページロード時にFormのActionを書き換えるらしい。 元の(Rewriteされた)URLを保存しているServerVariableを使う。 protected void Page_Load(object sender, EventArgs e) { if ( !String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"])…