为什么 awstats 报告我的静态 IP 而不是域名?

为什么 awstats 报告我的静态 IP 而不是域名?

在 AWStats 中,在“来自外部页面的链接(搜索引擎以外的其他网站)”下,它生成了链接到我的页面的页面列表。我看到的页面包括:Bing、YouTube、HotFrog 等。但是,页面内有许多内部链接。在底部,它报告如下:

http://72.249.150.9/distributors.php           5     2.4 %
http://72.249.150.9/contact/                   5     2.4 %
http://72.249.150.9/catalog/                   4     1.9 %
http://72.249.150.9/flex-point-hockey-grip.php 5     2.4 %
http://72.249.150.9/sticky-grip-foam.php       5     2.4 %
http://72.249.150.9/video.php                 10     4.8 %
http://72.249.150.9/dealers/                   5     2.4 %
http://72.249.150.9/feedback/                  5     2.4 %
http://72.249.150.9/products.php              10     4.8 %
http://72.249.150.9/ergo-hockey-grip.php       5     2.4 %

笔记:由于 SSL 要求,因此设置了静态 IP。

答案1

因为您的网站也通过其 IP 地址(没有您的域名)被访问。除非您配置 HostAliases 配置指令,否则 AWStats 不知道这是同一个网站。将其添加到您的 AWStats 配置中:

HostAliases="72.249.150.9"

另一个解决方案是将通过 IP 地址访问您网站的访问者重定向到您的域名(无论如何我都会推荐这个)。您可以使用 mod_write 和一个.htaccess文件来实现这一点:

RewriteEngine On
RewriteCond %{HTTP_HOST} !.*?your.domain$ [NC]
ReWriteRule /(.*)$ http://www.your.domain/$1 [R=301,L]

答案2

[johnathan@VM:~] $ host 72.249.150.9
Host 9.150.249.72.in-addr.arpa. not found: 3(NXDOMAIN)

您需要为该 IP 设置反向 DNS,以便您的 Web 服务器可以将 IP 映射回域名。您的 ISP 通常可以帮助您完成此操作,或者,如果您从家庭 IP 运行服务器,请查看 dyndns.org 提供的免费服务等。

[johnathan@VM:~] $ host 109.xxx.xxx.131
131.26.169.109.in-addr.arpa domain name pointer starscream.xxxxxxxxx.com.
[johnathan@VM:~] $ host starscream.xxxxxxxxx.com
starscream.xxxxxxxxx.com has address 109.xxx.xxx.131

这就是您应该获得的回报……仅供参考。

希望这可以帮助 :)

相关内容