如何让多域名重定向到一个网站

怎样实现多域名重定向到一个站点?相信大家还没学会这个技能。通过这篇文章的详细解说希望你能学会。跟随小编一起来看步骤吧。

教程开始:

ABC.com

www.ABC.cn

www.ABC.net

ABC.cn

ABC.net

上面五个都重定向到

www.ABC.com

IIS7以上可直接添加在web.config配置文件里面实现

<configuration>

<system.webServer>

<rewrite>

<rules>

<rule name="301-1 Redirect" stopProcessing="true">

<match url=".*" />

<conditions>

<add input="{HTTP_HOST}" pattern="^ABC.com$" />

</conditions>

<action type="Redirect" url="http://www.ABC.com/{R:0}" redirectType="Permanent" />

</rule>

<rule name="301-2 Redirect" stopProcessing="true">

<match url=".*" />

<conditions>

<add input="{HTTP_HOST}" pattern="^ABC.net$" />

</conditions>

<action type="Redirect" url="http://www.ABC.com/{R:0}" redirectType="Permanent" />

</rule>

<rule name="301-3 Redirect" stopProcessing="true">

<match url=".*" />

<conditions>

<add input="{HTTP_HOST}" pattern="^ABC.cn$" />

</conditions>

<action type="Redirect" url="http://www.ABC.com/{R:0}" redirectType="Permanent" />

</rule>

<rule name="301-4 Redirect" stopProcessing="true">

<match url=".*" />

<conditions>

<add input="{HTTP_HOST}" pattern="^www.ABC.net$" />

</conditions>

<action type="Redirect" url="http://www.ABC.com/{R:0}" redirectType="Permanent" />

</rule>

<rule name="301-5 Redirect" stopProcessing="true">

<match url=".*" />

<conditions>

<add input="{HTTP_HOST}" pattern="^www.ABCcn$" />

</conditions>

<action type="Redirect" url="http://www.ABC.com/{R:0}" redirectType="Permanent" />

</rule>

</rules>

</rewrite>

<httpRedirect enabled="false" destination="http://www.ABC.com" exactDestination="true" httpResponseStatus="Permanent" />

</system.webServer>

</configuration>

解析设置:

第1种实现方式:记录类型为A记录,记录值为IP地址 主机记录为@和WWW

第2种方式:如果买的是虚拟主机,一般在虚拟主机的具体信息上,可以查到别名,把服务商提供的这个别名做为记录值,
记录类型为cname,主机记录为@和WWW,也可以实现

看完上述内容,你们学会多域名重定向到一个站点的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

版权申明:本站文章均来自网络,如有侵权,请联系01056159998 邮箱:itboby@foxmail.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

猜你还会喜欢下面的内容

    无相关信息

中国领先的互联网域名及云服务提供商

为您提供域名,比特币,P2P,大数据,云计算,虚拟主机,域名交易最新资讯报道

域名注册云服务器