I-Wildcard DNS kunye neDynamic Subdomains

Ngalo lonke ixesha lam lokuphumla (ha!), Bendisebenza ukusonga Iintaka zasendle Imephu engenamkhawulo Isicelo nesicelo seshishini esiya kuvumela abantu ukuba bayile eyabo indawo yokugcina ivenkile. Ukuphuhlisa eyam iSoftware njengesisombululo seNkonzo kuye kwaba yinjongo yam iminyaka eliqela, kwaye eli lithuba elihle.

Zimbini izinto ezibalulekileyo kwishelufa endifuna ukuyifaka kwisicelo esiya kuba ngumceli mngeni omkhulu ngenxa yoko bendifuna ukuxoxa ngazo kwimeko okhe wafuna ukwenza okufanayo. Zombini ezi zinto zixhaphakile kuzo zonke izicelo, kodwa ndiye ndafumanisa ukuba nangona ziqhelekile, ababoneleli abaninzi ababambeleyo abaxhasi!

Injongo yam kukwakha isicelo senkonzo yokuzenzela apho umthengi anokumisela khona isiseko sakhe (http://nditsho.myapplicationdomain.com), okanye basebenzise eyabo i-subdomain (http://nditsho.yourdomain.com). Ukuze ibe yinkonzo yokuzimela, ifuna ukukwazi ukwenza isisombululo-kodwa ifikelela kwezinye iifayile zeefayile zokucwangciswa kweeseva ezingavumelekanga kuninzi lweeakhawunti zokubamba! Umcimbi yinkxaso ye-Wildcard DNS, Oko kukuthi, ukukwazi ukukhomba nasiphi na isiseko sendawo kwisizinda seseva. Ngamanye amagama, test.domain.com okanye www.domain.com okanye any.domain.com zonke zikhomba kwindawo enye. Nokuba ubhale ntoni-iya kusebenza.

Ngaphandle kwezicelo, le nto yinto entle ukuba yenziwe- nakwibhlog yakho. Ingavumela nabani na ukuba abhale into.yourdomain.com kwaye ubazise lakho.com. Uya kumangaliswa kukuba zingaphi amakhonkco amabi apho akhomba ibhlog yakho okanye iwebhusayithi. Oko kunokuphoswa kukugcwala kwabantu ukuba umntu akaboni ukuba yimpazamo enekhonkco.

Inkqubo isebenza ngokubhala kwakhona isiseko esingezantsi kwindawo yokubuza umbuzo ngaphambi kokuba iphepha linikezelwe ngumncedisi wewebhu… ke i-domain.com ngokoqobo itolikwa ngamaseva e-Apache njenge-domain.com? What=subdomain ngokusebenzisa ifayile ye-htaccess:

# Khipha icandelo le-subdomain le-domain.com
Phinda ubhale iCond% {HTTP_HOST} ^ ([^ ^.] +) \ .Domain yakho. .Com $ [NC]
 
# Jonga ukuba icandelo le-subdomain alinguwo www kunye ne-ftp kunye neposi
Phinda ubhale iCond% 1! ^ (Www | ftp | imeyile) $ [NC]
 
# Phinda uthumele zonke izicelo kwisikripthi se-php esigqitha njengengxoxo kwisizinda
Phinda ubhaleRule ^. * $ Http://www.yourdomain.com/%1 [R, L]

Kukho ulwazi olongezelelweyo kwiifayile ofuna ukuhlela kuzo Vnessa.net. Qaphela ukuba iifayile azinakubekwa apho zichazwe ngokuxhomekeke kumboneleli wakho wokubamba. Umboneleli wam wokusingathwa okunene uyabaxhasa abantu abagxuphuleka, kodwa bayalumkisa ukuba ukwenza njalo kungaphelisa inkxaso yabathengi. Kunye 'nokuqhekeka emngciphekweni wakho', abayi kufikelela ukukunceda, nokuba.

Ndiza kusebenza ekuphuhliseni konke ukusetyenziswa kwesicelo kunokuba ndixhomeke kuphuhliso lwesizinda. Ndiza kunika CakePHP Ifoto oyisebenzisayo njengesikhokelo sayo!

Inqaku lokugqibela, ndiyinto encinci kule nto. Ndisikelelekile ngamaqela ophuhliso emsebenzini wam ukuze ndiqonde ezi zinto. Ngokwam, ndinobungozi obuncinci. Nayiphi na ingxelo noncedo iyaxatyiswa!

3 Comments

  1. 1

    Phole kakhulu. Ngenene ndisebenzise iseva yam yegama lombhalisi nge-wildcard DNS xa ndikunye ne-SliceHost, kwaye ndine-Apache eqwalaselweyo ukuze isebenze i-subdomains engaqwalaselwanga ukusuka kwiifayile zemimandla eqhelekileyo.

    Ndonwabile ngokwenene ukujonga isakhelo seCakePHP, kodwa ikhonkco lakho lifile 🙂

    I-CakePHP inokufumaneka kwi http://cakephp.ORG

    • 2

      Bendicinga ngokuya kwindlela yobhaliso ngokunjalo, Alex. Ngumbono omhle lowo – mhlawumbi yeyona ndlela ilungileyo yokusingatha le nto.

      Uxolo malunga nekhonkco elifileyo - lilungisiwe ngoku.

  2. 3

Ingaba ucinga ntoni?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda indlela idatha yakho yokubhaliweyo isetyenziswe ngayo.