2011-08-14 12 views

答えて

0

私は調査し、私の答えを見つけました。私たちは{C:1}を使用できる条件で変数を使用します。 1は最初の試合のためのものです。そして、この変換のための私のecxact答えは:に等しい

 <rules> 
      <rule name="http Redirect" stopProcessing="true"> 
       <match url="^(.*)$" ignoreCase="false" /> 
       <conditions> 
        <add input="{HTTP_HOST}" pattern="^www\.(.*)$" /> 
        <add input="{SERVER_PORT_SECURE}" pattern="^0$" /> 
       </conditions> 
       <action type="Redirect" url="http://{C:1}/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
      </rule> 
      <rule name="https Redirect" stopProcessing="true"> 
       <match url="^(.*)$" ignoreCase="false" /> 
       <conditions> 
        <add input="{HTTP_HOST}" pattern="^www\.(.*)$" /> 
        <add input="{SERVER_PORT_SECURE}" pattern="^0$" negate="true" /> 
       </conditions> 
       <action type="Redirect" url="https://{C:1}/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
      </rule> 
     </rules> 

RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] 
RewriteCond %{HTTPS} ^off$ [NC] 
RewriteRule ^(.*)$ http://%1/$1 [L,QSA,R=302] 
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] 
RewriteCond %{HTTPS} ^on$ [NC] 
RewriteRule ^(.*)$ https://%1/$1 [L,QSA,R=302] 

グッドラック

関連する問題