2017-12-08 1 views
0

Ich hatte ein Problem. Es gibt eine Hauptdomain https://example.com Ich habe eine Umleitung von http zu https. Alles funktioniert, aber es gibt ein Problem, wenn ich versuche, in der URL-Adresse Anfrage Zeile www.example.com/exam/exam zu drucken, werde ich auf die Maim-Seite umgeleitet und in der Adressanforderungszeile sehe ich die folgende Adresse: https//example.com und andere Anfragen sind gelöscht. Aber wenn ich in die Adressleiste https://example.com/exam/exam - eingeben, dann funktioniert alles. Ich brauche deine Hilfe und berate darüber, wie ich das Neuschreiben verbessern kann und was in meinem Code falsch ist.Wie man zusammen umleiten Redirect 301 umschreiben iis-8.5?

<rule name="Redirect to HTTPS" enabled="false" patternSyntax="Wildcard" stopProcessing="true"> 
       <match url="*" /> 
       <conditions> 
        <add input="{HTTPS}" pattern="^ON$" /> 
        <add input="{HTTP_HOST}" pattern="^([\d\w\.]+)" /> 
       </conditions> 
       <action type="Redirect" url="https://{C:1}/{REQUEST_URI}" /> 
      </rule> 
      <rule name="RedirectDoubleHTTPS" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> 
       <match url="*" /> 
       <conditions> 
        <add input="{HTTPS}" pattern="off" /> 
       </conditions> 
       <action type="Redirect" url="https://example.com" /> 
      </rule> 

Antwort

0

Das Problem in Ihrer zweiten Regel. Es sollte so sein:

<rule name="RedirectDoubleHTTPS" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> 
    <match url="*" /> 
    <conditions> 
     <add input="{HTTPS}" pattern="off" /> 
    </conditions> 
    <action type="Redirect" url="https://example.com{REQUEST_URI}" /> 
</rule> 

Auch Ihre erste Regel kleinere fix haben. Stattdessen sollte https://{C:1}/{REQUEST_URI}"https://{C:1}{REQUEST_URI}"

sein