現在國內的博客都不支持綁定頂級域名了,大多給你一個類似於xx.com/dd/的網址,讓你域名cname都沒有地方,查了下資料,找到了url隱藏轉發的方式,代碼實現如下:
1 <html>
2 <head>
3 <meta http-equiv="Content-Language" content="zh-CN">
4 <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
5 <title>yaoyue68's blog</title>
6 </head>
7 <frameset framespacing="0" border="0" rows="0" frameborder="0">
8 <frame name="main" src="http://www.xx/xx/" scrolling="auto" noresize>
9 </frameset>
10 </html>
把它保存為index.html,放到github你創建的“用戶名.github.io”項目里(不明白請查看github項目主頁的設置方法),接着在github項目cname文件里綁定你的頂級域名,dns里設置cname到"http://用戶名.github.io"上即可。
這樣設置完了,url是不會變動的,好像還有改進的方法,就是用“#”標記文章地址,用js控制讀取url訪問,我再琢磨下。。。
---------
frameset好像是不能跨域名調用的吧?那樣的話就只能這樣子了.....