作者roga (凝视)
看板java
标题Re: [问题] 客制化网址
时间Sun Oct 19 23:59:38 2008
※ 引述《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