2016-03-28 3 views
0

URLリダイレクトエントリを作成しました。最初は手動で試してみましたが、動作させることはできませんでした。次に、IISインターフェイスを使用して作成しました。すべてのテストを実行し、彼らは合格と言う。私は今404エラーを得る。URLをリダイレクトして、サブドメインとサブフォルダを含むIISを正常にテストしますが、生成します。404

<rewrite> 
    <rules> 
    <rule name="subdomain redirect" enabled="true" stopProcessing="true"> 
     <match url="^(?!www)(.*).domain.nl/(.*)$" ignoreCase="true" /> 
     <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> 
     <add input="{HTTP_HOST}" pattern="^(?!www)(.*)\.domain\.nl\/(.*)$" /> 
     </conditions> 
     <action type="Redirect" url="http://www.domain.nl/external/Login.aspx?org={C:2}" /> 
    </rule> 
    </rules> 
</rewrite> 

私がhttp://foo.domain.nl/AnyExistingPage.aspxに行くと、すべて正常に動作します。 リダイレクトは発生していません。

ので、目標は、このURLをリダイレクトすることです:http://foo.domain.nl/stack 次のURL:つまりhttp://www.domain.nl/external/Login.aspx?org=stack

サブドメインはWWWされていない場合は、その後、リダイレクトURLのパラメータとしてサブフォルダを取ります。残りのページがfoo.domain.nlで動作しない場合は問題ありません。

提案がありますか?

答えて

0

は、この方法を試してください。

<rules> 
    <rule name="subdomain redirect" enabled="true" stopProcessing="true"> 
     <match url=".*" ignoreCase="true" /> 
     <conditions> 
     <add input="{HTTP_HOST}" pattern="www.domain.nl" negate="true" /> 
     </conditions> 
     <action type="Redirect" url="http://www.domain.nl/external/Login.aspx?org={R:0}" /> 
    </rule> 
    </rules> 
関連する問題