繁体   English   中英

IIS 8.5 URL重写更改TLD

[英]IIS 8.5 URL rewrite change TLD

我想在IIS 8.5中创建一个重写规则,以便url中的TLD从.com更改为.net。

例:

来自: http//sub.domain.com/index.aspx?test = 123

to: http//sub.domain.net/index.aspx?test = 123

目前我在web.config中得到了类似的东西,但似乎不起作用:

   <rule name="TLD" enabled="false">
       <match url="(.*)" />
       <conditions>
           <add input="{HTTP_HOST}" pattern="^(www.)?([a-z]*.)(domain)(.com)(/?.*)$" />
       </conditions>
       <action type="Rewrite" url="http://{C:2}{C:3}.net/{C:5}" />
   </rule>

有什么建议么?

我正在寻找完全相同的问题并找到了这个

 <rule name="WWW" enabled="true" stopProcessing="true">
     <match url=" (.*)"/>
     <conditions >
        <add input="{HTTP_HOST}" pattern="^(www\.)?example\.old$"/>
     </conditions>
     <action type="Redirect" url="h++p://example.com/{R:1}" redirectType="Permanent" />
 </rule>

在此处找到: 重写顶级域名(TLD)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM