There’s only 3 stpes to set up.
Create CNAME file
Create a file named CNAME that path should be/source/CNAME
and field in your domain. In my case, it should beblog.codewalker.me
.notice
There would be nohttp://
orhttps://
etc.1
2cat CNAME
blog.codewalker.meSetup domain
Setup you DNS to add a subdomain as CNAME to you GitHub pages domain.
Refers mine, it should beblog.codewalker.me
tocodewalkertse.github.io
Step 3 or not
In my case, I should make codewalker.me redirect to blog.codewalker.me.
In my Nginx Server the.conf
should be like this:1
2
3
4
5
6server {
listen 80;
server_name codewalker.me www.codewalker.me;
rewrite ^/(.*) http://blog.codewalker.me/$1 permanent;
access_log off;
}To make all request redirect to blog.codewalker.me by 301 signal.
Have fun with hexo
I love this world
EOF