※ 引述《plokijuh (瘋人院院長)》之銘言:
: ※ 引述《infinitlee (...)》之銘言:
: : 最近在工作上,主管請我研究要如何將domain name 做的像bloger 那樣
: : 也就是 http://username.blogger.com,並且運作正常
: : 感覺不像是硬體方面能做的,應該是web 程式要處理的,不曉得有哪位知道
: : blogger 大概怎麼做,或者有相關技術... 謝謝
: 大致上是利用 rewrite + dns
: dns 設定
: example.com. 86400 IN A 111.222.111.222
: *.example.com. 86400 IN CNAME example.com.
這個設定很必須
apache 裡面的
ServerAlias 也要設定。
ServerName example.com
ServerAlias *.example.com
: 再用 rewrite
: 將 subdomain rewrite
: http://username.example.com/
: 重寫至下列網址
: http://example.com/post.php?user=username
: 我自己是沒實做過
: 不過看來應該可行
: 參考資料
: http://30cmLP.tw/7mqsq9
: google 搜尋關鍵字 "user name subdomain"
倒是不用 rewrite 拉..
如果 Java 可以判斷鍵入的網址的話,那直接對字串拆解就知道了
一年多前我有用 php 實做過 http://topdn.net
--
凝視著,卻看不見光景。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.130.223.207
討論串 (同標題文章)