1

次のコマンドでappcmd.exeを使用して相対リダイレクトを設定しようとしています。

appcmd.exe set config "Website" -section:system.webServer / httpRedirect / enabled: "True" / destination: "/ Login / UnderConstruction.aspx" / httpResponseStatus: "Found"

「ウェブサイト」には"http://localhost:81"

ただし、これは再帰的なリダイレクトを引き起こしているようです。これは、にアクセスするlocalhost:81と、次のパスが生成されるためです。

http://localhost:81/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/Login/UnderConstruction.aspx/

私はグーグルでこれを検索しましたが、同じ問題を抱えている人を見つけることができません。再帰的なリダイレクトを発生させずに、すべてのサイト要求をそのサイトに相対的なパスにリダイレクトする方法はありますか?

4

1 に答える 1

1

httpredirect内のワイルドカードを使用してこれを解決しました

たとえば、次のスクリプトは機能します。

appcmd.exe set config "Website" -section:system.webServer/httpRedirect /+"[wildcard='*.aspx',destination='/Login/UnderConstruction.aspx']" /destination:"" /enabled:"True" /exactDestination:"False" /childOnly:"False"
于 2012-09-07T15:54:02.360 に答える