Azure http://example.com 有效,但www.example.com无效
全部,标题说明了一切。我在GoDaddy注册了一个域名,并在Azure中设置了一个web应用程序。在Godaddy,我已经正确设置了我的CName和A文件,这是我所能知道的 我一定对它们做了正确的处理,就像我在浏览器的地址栏中键入index.html一样。然而,当我输入www.example.com时,我得到Azure的404错误/页面,该页面表示找不到页面 我很困惑。有人能帮忙吗?谢谢。只是为了确定一下Azure http://example.com 有效,但www.example.com无效,azure,Azure,全部,标题说明了一切。我在GoDaddy注册了一个域名,并在Azure中设置了一个web应用程序。在Godaddy,我已经正确设置了我的CName和A文件,这是我所能知道的 我一定对它们做了正确的处理,就像我在浏览器的地址栏中键入index.html一样。然而,当我输入www.example.com时,我得到Azure的404错误/页面,该页面表示找不到页面 我很困惑。有人能帮忙吗?谢谢。只是为了确定一下 A Record * > your ip @ > your ip CName
A Record
* > your ip
@ > your ip
CName
www > @
检查服务器配置(例如,我在ubuntu中使用apache2)
服务器管理员admin@example.com
DocumentRoot“/home/www.example.com/”
ServerName example.com
ServerAlias*.example.com
重新启动发动机
重写条件%{HTTP_HOST}^www\.(.*)$[NC]
重写规则^(.*)$http://%1$1[R=permanent,L]
选项索引跟随符号链接
允许超越所有
命令允许,拒绝
通融
= 2.3 >
要求所有授权
重要的部分是
ServerAlias
,重写规则请详细说明您设置的确切DNS条目。您是否也在Azure中添加了www
主机名?如果它有效,请不要忘记接受这个答案,这样也会帮助有相同问题的人
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot "/home/www.example.com/"
ServerName example.com
ServerAlias *.example.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [R=permanent,L]
<Directory "/home/www.example.com/">
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory></VirtualHost>