Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.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
IIS重定向到完整域名_Iis_Iis 7 - Fatal编程技术网

IIS重定向到完整域名

IIS重定向到完整域名,iis,iis-7,Iis,Iis 7,我需要重新定向 http://someserver/someapplication.page.aspx 到 http://someserver.domain.com/someapplication.page.aspx 两个请求都指向同一台服务器 someserver/通过我们公司的内部DNS工作 这和我的问题是一样的 但是我想要一个IIS解决方案,而不是代码。我猜这与使用通配符在配置编辑器中添加httpRedirect add元素有关。您可以使用URL重写作为在IIS中执行此操作的推荐方法,只需

我需要重新定向

http://someserver/someapplication.page.aspx
http://someserver.domain.com/someapplication.page.aspx

两个请求都指向同一台服务器

someserver/
通过我们公司的内部DNS工作

这和我的问题是一样的


但是我想要一个IIS解决方案,而不是代码。我猜这与使用通配符在配置编辑器中添加httpRedirect add元素有关。

您可以使用URL重写作为在IIS中执行此操作的推荐方法,只需使用如下规则添加一个web.config:

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Redirect to full domain" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^someserver$" />
          </conditions>
          <action type="Redirect" url="http://someserver.domain.com/{R:0}" redirectType="Permanent" />
        </rule>
      </rules>

    </rewrite>
  </system.webServer>
</configuration>


上述内容是否会进入重定向循环?因为在我的示例中,
someserver/
someserver.domain.com/
都在同一台服务器上,我想我找到了我应该研究的问题-感谢您指出我们的方法,重写模块就是这样做的方法看起来就像