Wildcard DNS na Dynamic Subdomains

N'oge m niile mapụtara oge (ha!), M na-arụ ọrụ iji kechie Nnụnnụ Nnụnnụ Unlimited Map itinye ngwa nke ga-eme ka ndị folks chepụta ebe obibi ha. Zụlite sọftụwia nke m dịka azịza ọrụ m bụ ihe mgbaru ọsọ m maka afọ ole na ole, nke a bụ ohere dị ukwuu.

E nwere isi ihe abụọ dị na shelf m chọrọ itinye na ngwa ahụ nke na-abụ nnukwu nsogbu ka m wee chọọ ịtụle ha n'ihe omume ị na-achọ ime otu ihe ahụ. Atụmatụ abụọ a bụ ebe a na-ahụkarị na ngwa niile, mana abịawo m chọpụta na n'agbanyeghị na ha bụ ebe nkịtị, ọtụtụ ndị na-eweta Bochum anaghị akwado ha n'ezie!

Ihe mgbaru ọsọ m bụ iwu ngwa ọrụ onwe onye ebe onye ahịa nwere ike hazie subdomain nke ha (http://subdomain.myapplicationdomain.com),, ma ọ bụ ọbụna tinye subdomain nke ha (http://subdomain.nke.com). Ka o wee bụrụ ọrụ onwe ya, ọ chọrọ ikike ịhazi ihe ngwọta - mana ọ na-enweta ụfọdụ ngalaba aha ihe nkesa aha nhazi faịlụ ndị na-anọghị-oke na ọtụtụ ndị nnabata akaụntụ! Okwu a bụ nkwado maka Wildcard DNS, ya bụ, inwe ike ịkọwa subdomain ọ bụla na ngalaba nke sava ahụ. N'aka ozo, test.domain.com ma obu www.domain.com ma obu any.domain.com ha nile turu aka n'otu ebe. N'agbanyeghị ihe ị dere - ọ ga-arụ ọrụ.

Na mpụga nke ngwa, nke a bụ n'ezie ezigbo mma atụmatụ enyerela - ọbụna na blog gị. Ọ ga-enye onye ọ bụla ohere ide ihe ọ bụla.nke.com kpọtakwa ha yourdomain.com. Ọ ga-eju gị anya na ọtụtụ njikọ ọjọọ enwere ebe ahụ na-ezo aka na blọgụ gị ma ọ bụ weebụsaịtị. Enwere ike ịhapụ okporo ụzọ ma ọ bụrụ na onye ahụ amaghị na ọ bụ njehie na njikọ ya.

Usoro a na - arụ ọrụ site na ịdegharị subdomain ahụ na querystring tupu webserver sụgharịrị peeji ahụ n'ezie… so subdomain.domain.com n'ezie na - atụgharịrị ndị sava Apache dị ka domain.com?what=subdomain site na iji faịlụ htaccess:

# Wepụ ngalaba subdomain nke ngalaba.com
RewriteCond% {HTTP_HOST} ^ ([^ \.] +) \ Yourdomain \ .com $ [NC]
 
# Lelee na akụkụ subdomain abụghị www na ftp na mail
RewriteCond% 1! ^ (Www | ftp | mail) $ [NC]
 
# Redirect niile arịrịọ ka a PHP akwukwọ na-agafe dị ka mgbagha na subdomain
RewriteRule ^. * $ Http://www.yourdomain.com/%1 [R, L]

Enwere ụfọdụ ozi ndị ọzọ na faịlụ ịkwesịrị idezi na V-nessa.net. Rịba ama na faịlụ ahụ agaghị adị ebe akọwapụtara dabere na ndị na-eweta gị. Onye na - eweta nnabata m na - akwado ndị na - etinye aka na ya, mana ha na - adọ aka na ntị na ịme nke a nwere ike ghara ị nweta nkwado ndị ahịa. Nakwa dị ka 'mbanye anataghị ikike gị n'ihe ize ndụ', ha agaghị na-aga inyere gị aka, ma.

Aga m arụ ọrụ na-emepe emepe ihe fọdụrụnụ ngwa kama ịnọ na-ekokwasị na subdomain development. M n'ezie ga-enye CakePHP ogbugba iji buru ihe eji eme ya!

Ikpeazụ dee, M a bit nke mbanye anataghị ikike a stof. Enwere m ndị otu mmepe na ọrụ m ka m chọpụta ihe a. N’onwe m, adị m obere ihe egwu. Enwere nzaghachi na enyemaka ọ bụla!

3 Comments

  1. 1

    Very cool. I actually used my registrar’s name server with wildcard DNS when I was with SliceHost, and had Apache configured to serve unconfigured subdomains from the regular domains files.

    Ọ masịrị m nke ukwuu ileba anya na CakePHP, mana njikọ gị anwụọla 🙂

    Enwere ike ịchọta cakePHP na http://cakephp.ORG

    • 2

      I was thinking about going the registry route as well, Alex. That’s a great idea – probably the best way to handle this.

      Ndo banyere njikọ ndị nwụrụ anwụ - edozila ya ugbu a.

  2. 3

    ị jisiri ike chọta onye na-eweta ọrụ nke nyere gị ohere ịme nke a? (ewezuga site na ịgbazite ihe nkesa raara onwe ya nye)

Kedu ihe ị chere?

Ebe a na-eji Akismet iji belata spam. Mụta otu esi etinye usoro data gị.