2016-03-28 11 views
0

Ich habe eine Website unter domain.com. Ich habe kürzlich ein SSL-Zertifikat installiert, damit ich HTTPS verwenden kann.URL mit www verursacht 404 in IIS

In IIS habe ich Bindungen für domain.com und www.domain.com für http und https erstellt. Dann habe ich eine URL Rewrite-Regel in meine web.config, die jede URL passt sich https://domain.com

Mein Problem ist, dass, wenn ich auf http://domain.com oder https://domain.com gehen die Website funktioniert, aber http://wwww.domain.com und https://www.domain.com nicht. Ist das ein Problem mit meinen Rewrite-Regeln oder meiner Bindung?

Hier ist meine web.config als Referenz:

<configuration> 
<system.webServer> 
    <rewrite> 
     <rules> 
<rule name="Redirect to HTTPS" stopProcessing="true"> 
    <match url="(.*)" /> 
    <conditions> 
    <add input="{HTTPS}" pattern="^OFF$" /> 
    </conditions> 
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" /> 
</rule> 
      <rule name="Imported Rule 1"> 
       <match url="^(register)$" /> 
       <conditions logicalGrouping="MatchAll"> 
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
       </conditions> 
       <action type="Redirect" url="https://domain.com/register.php" redirectType="Found" /> 
      </rule> 
     </rules> 
    </rewrite> 
</system.webServer> 

Antwort

0

i lösen dieses Problem haben wie dieser Code-Block.

<rewrite> 
     <rules> 
      <rule name="http to https" stopProcessing="true"> 
       <match url="(.*)" /> 
       <conditions> 
        <add input="{HTTPS}" pattern="^OFF$" /> 
       </conditions> 
       <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Temporary" /> 
      </rule> 
     </rules> 
    </rewrite> 
Verwandte Themen