我正在尝试访问我的服务器的以下地址:
https://www.media-rewards.com/
但它不起作用:(。
但是,如果我使用它的 IP 地址,它就可以工作:
https://52.0.245.209/
我不知道这两个问题是否有关联,但是:我可以访问默认的 apache 页面(/var/www/html/index.html)
http://52.0.245.209/
我想将其重定向到 https 地址,我在 apache 配置中尝试过:
<VirtualHost *:80>
ServerName www.media-rewards.com
Redirect permanent /var/www/html https://www.media-rewards.com/
</VirtualHost>
<VirtualHost *:443>
ServerName www.media-rewards.com
Redirect permanent /var/www/html https://www.media-rewards.com/
</Virtualhost>
答案1
我怀疑这是因为 DNS 中的 A 记录www.media-rewards.com
不是指向52.0.245.209
,而是54.76.29.199
。
# dig www.media-rewards.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 <<>> www.media-rewards.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18713
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.media-rewards.com. IN A
;; ANSWER SECTION:
www.media-rewards.com. 10800 IN A 54.76.29.199
;; Query time: 335 msec
;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx)
;; WHEN: Wed Mar 25 07:23:20 2015
;; MSG SIZE rcvd: 55