Dns添加www前缀? [英] Dns add www prefix?
本文介绍了Dns添加www前缀?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
apache重定向从非www到www
可以配置DNS以添加www。前缀到域名?
Is it possible to configure DNS to add www. prefix to the domain name?
推荐答案
不,您必须将网络服务器配置为 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前缀?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文