DNS加上www preFIX? [英] Dns add www prefix?
本文介绍了DNS加上www preFIX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
阿帕奇非WWW到www 重定向
是否有可能配置DNS,添加WWW。 preFIX的域名?
Is it possible to configure DNS to add www. prefix to the domain name?
下面是该的例子
推荐答案
不。你必须要在配置Web服务器 yourdomain.com
来重定向到 www.yourdomain.com
。
Nope. You have to configure the webserver at yourdomain.com
to redirect to www.yourdomain.com
.
例如,在Apache,您可以使用此配置(使用 mod_alias中
)
For example, on apache, you can use this configuration (using mod_alias
):
<VirtualHost *:80>
ServerName www.yourdomain.com
## Actual configuration here...
</VirtualHost>
<VirtualHost *:80>
## redirect non-www to www
ServerName www.yourdomain.com
ServerAlias yourdomain.com
RedirectMatch permanent ^(.*) http://www.yourdomain.com$1
</VirtualHost>
这篇关于DNS加上www preFIX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文