Ich habe diese Regel in meiner web.config hinzugefügt, um nicht www URLs an www umzuleiten.Umleiten von nicht www zu www Regel, die das Problem für Dateien verursacht
<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example.com$" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
</rule>
Obwohl es funktioniert gut für Haupt-URL. Wie, wenn Benutzertypen http://example.com es http://www.example.com umleitet
Aber für einige URLs wie
http://www.example.com/userfiles/abc.pdf
leitet es zu
http://www.www.example.com/userfiles/abc.pdf
Hier können Sie 2 mal www in URL sehen.