0

IIS7.5でSharePointサイトを実行しています。リクエストヘッダーに基づいて着信リクエストを許可/ブロックしたい。これが実装したい条件です。

ここで、clientIdとuserAgentはリクエストヘッダーです。

String clientId=Request.getHeaderValue('clientID');
String userAgent=Request.getHeaderValue('useragent');

//If clientId and userAgent are empty abort the request

 if(clientId.equals('') && userAgent.equals('')){

//Abort the request
} 

//If clientId is not empty but is not matching my expected value,then abort the    request.
if(!clientId.equals('') && !clientId.equals('1234'){

//Abort the request
}

//If userAgent is not matching my expected value ,then abort the request.
if(!userAgent.equals('myfavbroswer')){

//Abort the request

}

IISのURLRewriteModuleをすでに確認しましたが、目的を果たしていないようです。

これは、私が導入したい大まかなロジックです。IISサーバーとSharePointを初めて使用します。このロジックをサーバーに配置して、目的を達成できる場所を教えてもらえますか。

ありがとう。

4

1 に答える 1

0

URLRewriteは実際に私の目的を果たします。使用方法を知っている必要があります。条件を別の方法で記述する必要があります。これにより、任意の条件を作成できます。最初は少し混乱します。また、正規表現を知っている場合は、使用するのに非常に優れたモジュールになります。

編集:このビデオは、これを達成する方法を非常によく理解しています。 http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-video-walkthrough

于 2012-08-01T10:51:40.903 に答える