如何将非www重定向到Windows服务器iis 7中的www [英] how to redirect non www to www in windows server iis 7
本文介绍了如何将非www重定向到Windows服务器iis 7中的www的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用www.domain.com ....但我需要将domain.com重定向到www.domain.com
我怎样才能实现这...
I am using www.domain.com....but i need to redirect domain.com in to www.domain.com
how can i achieve this...
推荐答案
我在谷歌搜索非www到www iis [ ^ ]并且第一个链接有答案。
从链接复制解决方案 -
以下添加web.config文件的规则元素:
I did a Google search for non www to www iis[^] and the very first link had an answer.
Copying the solution from the link -
Add below rule element to you web.config file:
<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^your.domain.name
/ >
< / conditions >
< action type = 重定向 url = http://www.your.domain.name/ {R:0} redirectType = 永久 / >
< / rule >
" /> </conditions> <action type="Redirect" url="http://www.your.domain.name/{R:0}" redirectType="Permanent" /> </rule>
请在询问前进行搜索。
Please do search before you ask.
这篇关于如何将非www重定向到Windows服务器iis 7中的www的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文