2012-12-05 11 views
6

हमारी वेब.कॉन्फिग फ़ाइल में हम 6 अलग-अलग अंतरराष्ट्रीय डोमेन नियंत्रित करते हैं।आईआईएस 7 एकाधिक डोमेन होम पेज कैनोनिकल रीडायरेक्ट

हम क्या कैसे करते हैं 1 नियम के साथ निम्नलिखित:

पुनर्निर्देशन

  • www.1of6Domains.com/index.htm
  • www.1of6Domains.com/index.html
  • www .1of6Domains.com/default.asp
  • www.1of6Domains.com/default.aspx
,210

को
  • www.1of6Domains.com

कुछ इस तरह?

<rule name="Canonical Redirect" enabled="true" stopProcessing="true"> 
    <match url="(.*)/(index.html|index.htm|default.asp|default.aspx)" /> 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" /> 
    <action type="Redirect" url="{R:1}" /> 
</rule> 

उत्तर

2

मैं के साथ जाना होगा:

<rule name="Canonical Redirect" enabled="true" stopProcessing="true"> 
    <match url="^index.html$|^index.htm$|^default.asp$|^default.aspx$" /> 
    <action type="Redirect" url="/" /> 
</rule> 

तो कह कर www.1of6Domains.com तुम्हारा मतलब प्रत्येक डोमेन तो कार्रवाई (मन में भालू है कि यह गैर https यातायात मान लिया गया है) होना चाहिए अलग हो सकता है: <action type="Redirect" url="http://www.1of6Domains.com" />

संपादित करें: यहां नियमों को एकाधिक डोमेन को संभालने के लिए कर रहे हैं (यह, एक नियम के साथ संभव है, लेकिन नक्शे को फिर से लिखने बनाया जा करने की आवश्यकता होगी, सुनिश्चित करें कि आप नहीं उस जटिलता को चाहते हैं):

<rule name="Canonical Redirect Non Https"> 
    <match url="^index.html$|^index.htm$|^default.asp$|^default.aspx$" /> 
    <action type="Rewrite" url="http://{HTTP_HOST}/" /> 
    <conditions> 
     <add input="{HTTPS}" pattern="^OFF$" /> 
    </conditions> 
</rule> 

<rule name="Canonical Redirect Https"> 
    <match url="^index.html$|^index.htm$|^default.asp$|^default.aspx$" /> 
    <action type="Rewrite" url="https://{HTTP_HOST}/" /> 
    <conditions> 
     <add input="{HTTPS}" pattern="^ON$" /> 
    </conditions> 
</rule> 
+0

उसी नियम का उपयोग करके 6 अलग-अलग डोमेन होंगे, इसलिए उन्हें उन सभी के लिए भी काम करने की आवश्यकता होगी। – Brent