set up sub domains on the fly ( 6 Views )
-
I was wondering is it possible to set up sub domains on the fly? I am building a site and basically a user can sign up for free and choose the name of his site, when he/she clicks submit I want it to set up there website under the sub domain www.sub.mysite.com
Is this possible ?
(ilksen hülya, New Caledonia)
Cool thanks guys, that sub domain create script works a treat and I can give all the users there own ftp if I go down the proper subdomain route ;)
You can see the script here
http://scripts.l33t-2k.net/
Only problem is that it doesnt give the subdomain with www at the start!
Only thing next is to write all the relevant CMS files to the users account once it has been created, so they can access it straight away :)
(tuba, India)
You'll need wildcard DNS enabled on your server if you go the mod_rewrite method BTW ;)
(Hale, British Indian Ocean Territory)
Quote:
Originally Posted by shad0w
Yes, but writing to a .htaccess file is very, very dangerous.
|
Don't write to one then ;)
Set it up so it detects the subdomain, uses that as the member id variable (or whatever), then the uri could be pass on as the page called.
site1.station.com/contact/
goes to
http://www.station.com/members.php?i...1&page=contact
All this would be an internal redirect, so the end user would never see the redirected URI. :)
Paul, I'm not 100% on the code to do it, but Pippo has posted about 20 different soilutions for this in the Cinfigure Your Server forum. Do a search in there, or post and wait for him to get back from vacation. :)
(emir han, Sweden)
You tried it on your server?
(ugur, Dominican Republic)
Yes, but writing to a .htaccess file is very, very dangerous.
(Hasan, Niger)
Use modrewrite.
Store the data in a database.
No need to use folders or "real" subdomains. :)
(musa, Mauritius)
Well creating lots of subdomains would seem to be more work than it has to be. I say when the user signs up and chooses a subdomain, have a folder created for that user and then write to a .htaccess file and add a mod_rewrite snippet. I would make sure that whatever info is written to the .htaccess file is heavily filtered because writing to that file can be very dangerous.
EDIT: Actually it is possible using sockets through php, atleast on my server. Read this: http://www.dr2.net/vB/showthread.php...ight=subdomain
(dilek, Saint Pierre and Miquelon)
Quote:
On the other hand, you can try your luck with exec() if you know command-line parameters to create subdomains on server...
|
nooooooooo
So instead of having to create 200 folders some of which might and might not be used, is it possible to automatically generate the file AND use the mod_rewrite map to it?
(irem, Switzerland)
hmm...
Since all the sites will work from one database (assumption: one server) you might as well host all their subdomains on your main server (site). That way you can create a foder for 'London' (ie. /home/station/london/) and have mod_rewrite map it as london.station.com...
On the other hand, you can try your luck with exec() if you know command-line parameters to create subdomains on server...
(sinan, Panama)
Well im not 100% sure what you mean, so I will explain more what I am doing and you can tell me if it will still work.
Basically the site will be powered by one database. There will be a main website page www.station.com and then each station around the country will be able to sign up www.london.station.com will be the sub domain. The people at that station will have there own littel site which will report all the shouts and activities that go on at that station. There will be approx 200 station websites. Each having a mini content management system where they can update there own little sites news/etc content.
All the sites will work from one database, so the main site will show the latest news etc from all the smaller sites ;)
As well as the sub domain being automatically generated, it would be ideal that a few files are automatically copied to the new subdomain site so its ready to go. But this is probably really difficult so for now, just the sub domain set up will do :)
(bahri, Mauritania)
just a thought: why don't you use url-rewriting to point it to the user´s home dir?
(recep, Palestinian Territory, Occupied)
I got an email telling me tmapm had just replied to this topic, but I cant see it can anyone else?
(aliekber, Poland)
Related Topics ... (or search in 1.720.883 topics !)
cheap, packable fly fishing set up? (16) set up multiple domains (2) i haave my sonydru510a and dvd rom set to master. i want to burn on the fly directly (5) set up same email accounts on .com and .co.uk domains (2) restricting access to a particular set of domains? (8) set up addon domains from website bypassing cpanel (7) on the fly captured ac3 (stereo and 5.1) decoding / playback on the fly? (1) register, transfer, renew domains with many features! domains low as $8.95/year! (1) urchin web analytics, fantastico, unlimited domains, $5.00 domains @ silverlime! (1)
copyright © 2007-2031 Pfodere.COM ( 5 Pfoyihuee Online )
|