怎样实现多域名重定向到一个站点?相信大家还没学会这个技能。通过这篇文章的详细解说希望你能学会。跟随小编一起来看步骤吧。
教程开始:
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,也可以实现
看完上述内容,你们学会多域名重定向到一个站点的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注创新互联行业资讯频道,感谢各位的阅读!
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网站标题:怎样实现多域名重定向到一个站点?-创新互联
本文URL:https://www.cdcxhl.com/article40/djpheo.html
成都网站建设公司_创新互联,为您提供微信公众号、品牌网站建设、商城网站、定制开发、微信小程序、标签优化
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联