खोज…


रीट्राइट नियम का उपयोग करके बल HTTPS

इस उदाहरण से पता चलता है कि आप HTTPS को वापस करने के लिए IIS रीट्राइट नियमों का उपयोग कैसे कर सकते हैं ताकि सभी HTTP अनुरोधों को HTTPS पृष्ठ पर 301 (स्थायी) पुनर्निर्देशन वापस कर सकें।

यह आमतौर पर [RequireHttps] विशेषता का उपयोग करने से बेहतर है क्योंकि विशेषता 302 रीडायरेक्ट का उपयोग करती है, और MVC पाइपलाइन में होने के कारण यह IIS स्तर पर करने की तुलना में बहुत धीमी है।

   <rewrite xdt:Transform="Insert">
      <rules>
        <rule name="Enforce HTTPS WWW" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="true">
            <add input="{HTTP_HOST}" pattern="^(?!www)(.*)"/>
            <add input="{URL}" pattern="^(.*)"/>
            <!-- {URL} Gives the base portion of the URL, without any querystring or extra path information, for example, "/vdir/default.asp". -->
          </conditions>
          <action type="Redirect" url="https://www.{C:1}{C:2}" appendQueryString="true" redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>


Modified text is an extract of the original Stack Overflow Documentation
के तहत लाइसेंस प्राप्त है CC BY-SA 3.0
से संबद्ध नहीं है Stack Overflow