Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何设置asp.net web.config将http重写为https,将www重写为非www_Asp.net_Url_Rewrite - Fatal编程技术网

如何设置asp.net web.config将http重写为https,将www重写为非www

如何设置asp.net web.config将http重写为https,将www重写为非www,asp.net,url,rewrite,Asp.net,Url,Rewrite,我在重写方面很在行,希望有人能帮我。 现在我用这个 <rewrite> <rules> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^(.*)" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{H

我在重写方面很在行,希望有人能帮我。 现在我用这个

<rewrite>
  <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^(.*)" ignoreCase="false" />
      <conditions logicalGrouping="MatchAll">
        <add input="{HTTPS}" negate="true" pattern="^on$" ignoreCase="false" />
      </conditions>
      <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="Found" />
    </rule>
  </rules>
</rewrite>

这只能将http更改为https,现在我希望它也能支持将www更改为非www。我该怎么做呢

为什么从web.config?您应该允许它从IIS访问-只需添加即可。

我正在使用共享主机,无法直接进入IIS,我只能使用web.config进行设置。