解决GitHub Pages的302转向问题

起因

NOTE: 如果给GitHub Pages使用的是子域名,按照GitHub Pages文档配置,不会出现该问题。

由于我在GitHub Pages上的搭的博客使用了theo.im这个根域名(Apex Domain),在按照 GitHub Pages文档上提供的信息,对theo.im设置了A记录,但是通过执行命令:

1
curl -I http://theo.im/sitemap.xml

发现得到的是302转向,不符合Sitemap协议的要求:

A successful request will return an HTTP 200 response code; if you receive a different response, you should resubmit your request. The HTTP 200 response code only indicates that the search engine has received your Sitemap, not that the Sitemap itself or the URLs contained in it were valid.

解决

通过搜索,我发现需要使用ALIAS记录解析根域名,但是由于我之前使用的是DNSPod 的服务,不支持ALIAS记录,因此决定换加DNS域名解析商。

经过一番搜寻,找到了两家支持ALIAS记录的DNS域名解析商:

  1. DNSimple: 全收费服务
  2. PointDNS: 有免费的开发者账户

本着能用收费不用免费的原则,因此我选择了 DNSimple 来解析我的域名 (゜o゜(☆○=(-_-)

OK,万文不如一图:

最后,运行 dig theo.im +nostats +nocomments +nocmd 检查DNS是否生效:

1
2
3
4
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> theo.im +nostats +nocomments +nocmd
;; global options: +cmd
;theo.im. IN A
theo.im. 3600 IN A 199.27.79.133

From Octopress To Hexo

It’s been a long time, Octopress is slow and painful to setup, after the death of my silly hard drive, I’m too lazy so I give up setting a Octopress environment, even writing new posts.

Eventually, I’m levaing, heading for Hexo.

What’s Hexo?

Hexo is a fast, simple and powerful blog framework. It parses your posts with Markdown or other render engine and generates static files with the beautiful theme. All of these just take seconds.

Why?

  • Painless installing
  • Cleaner documentation
  • Simple configuration
  • Fast generating, deploying
  • Easy customization
  • Actively maintained