Many programmer friends have built their own personal blog on GitHub Pages, for personal blog, if not included by the search engine, others are basically invisible, no matter how good the technical text can not be shared is useless.

Based on GitHub Pages’ personal blog, Google’s inclusion is timely and comprehensive. So far, however, GitHub has refused access to Baidu crawlers, returning 403 directly.

The official reason was that baidu crawlers crawled too hard, affecting the normal use of Github Pages service. As a result, any personal blog set up on Github Pages cannot be included by Baidu.

Existing solutions

1. Use Coding.net to build a mirror website

I used coding.net before. I added GitHub and Coding.net remote repo addresses to the configuration file of the local repo. When publishing, both addresses will be deployed, and intelligent domain name resolution will be added.

However, when accessing the personal home page through Coding.net, the jump page will appear first, leading to Baidu cannot correctly climb.

2. Use CDN

This has not tried, theoretically speaking, Baidu in the first time to climb, CDN must have the corresponding page cache, otherwise, climb the request will be forwarded to GitHub source site, GitHub will still refuse.

3. Use Nginx reverse proxy

Nginx does reverse proxy, directly proxy Baidu crawler, go to GitHub Pages request, and then return the result to Baidu crawler.

This works, but it requires some customization and, for individual developers, a VPS or cloud server.

Reliable, free and easy

Zeit.co is a static hosting service that can be automatically deployed using GitHub Hooks. Zeit provides storage + CDN + DNS.

I give personal website configuration is complete, go to Baidu webmaster tried, found that crawl successfully, sitemap also submitted successfully, waiting for Baidu included.

Below I record the steps of the configuration, to a friend in need of a reference.

The Zeit site has three main steps:

  • IO to grant read permission to zeit repo.

  • Import GitHub blog repo;

  • Wait a moment, deployment is successful.

The. In the project name is automatically replaced with -, which generates a link similar to XXXX.now. sh. Click to visit your blog home page. At this time, static resources have been deployed to zeit edge CDN node.

The next step is to switch the domain name and cut the domestic traffic through the smart DNS. IO DNS resolution service to configure their own domain name, and then in baidu webmaster configuration information.

Under Domains add your personal domain name for the project.

I add the following configuration error, the reason is that my domain name authority DNS is DNspod.

One solution is to use zeit’s Nameserver smart DNS directly, the other is to keep dnspod as the authoritative DNS server, but add an ANAME record.

There are two configuration methods, one is to change the nameserver, I use this one, the authoritative DNS server to the one on the left, I see you still use dnspod to resolve. Alternatively, keep dnspod as the authoritative DNS server, but add an ANAME record.

I used the first method, directly replacing the DNS authority server, directly using the Nameserver smart DNS provided by Zeit.

Go back to Zeit and refresh. This is normal. Here you can get HTTPS certificate for free.

It should be all right in a minute.

Take a look at the DNS resolution address to indicate that the ZEit domain name has been configured successfully.

Add individual domain name inside baidu stationmaster namely finally. Note that the HTTPS protocol is selected because zeit uses HTTPS by default.

I use file verification. Download the file and put it in the source directory of your blog’s local repo, deploy it to GitHub, and of course update it to Zeit. If it fails, check whether the fetched IP address is the same as the previous cache. Wait for some time to fetch the IP address again, depending on the TTL of DNS.

From zeit.co official website, Taiwan and Hong Kong have CDN nodes, free account can be 20G/ month, personal blog should be enough.

Configuration is still very simple, hurriedly try it, have a problem welcome to exchange.