Hello, Looking for a script that creates a subdomain on the fly and dumps some information into the directory created. That is you would call the script say script.php?subdomain=sb and it would automatically create a directory, update any files needed to be updated, and dump some info in the directory. I actually came across some posts recommending rewriting to directories versus creating actual subdomains. Any downfalls to doing this? Any thoughts would be greatly appreciated. My configuration is fedora 5 with apache and plesk. Many Thanks
Apache, you can use ModRewrite to emulate subdirectories. So when you hit the script, it could create the files on the fly, and update anything you want, just have them all DB driven.
thanks for the reply. I have seen a lot of people recommending ModRewrite. Well, isn't it better to create a 'real' subdomain instead of using the modrewrite?
Good Blog man - very useful Question is which is better the rewrite or the 'real' subdomain creation ?
These are two different things. A subdomain that you make on your website, would typically hold all files related to a particular subject or script. Mod rewrite takes variable string url's and makes them look like suddirectories, they could in reality be from any where on your website.
FlyByNight most companies allow change of the DNS. What company are you using? peaforabrain: Got some issues trying to get whats on the blog to work for me. I don't know if you are the owner of it, but here are the things I encountered. 1- I changing the DNS on my server and added the *.domain.com and directly after doing that I was able to get subdomain.domain.com to forward to domain.com - (didnt need to do the ServerAlias thing). 2- There was not virtual hosts part in my httpd.conf file located in /etc/httpd/conf/httpd.conf - so instead I located the conf file in the /var/www/vhosts/domain.com/conf directory - there I found a virtual host part and the stuff in it. Added what was necessary 3- As soon as I added the .htaccess file I started getting internal server error. Tried changing some stuff but that didnt work too. So still no soluion. I think this majorly has to do with me using plesk. You've seen this before?
Plesk have a script for creating subdomains (I am looking for this script at the mement - when I find it I'll post the info here). The problem is that this script should be executed with higher permissions that the regular php scripts - so you need to execute it with a cron job.
There are very few scripts.. Which is why we wrote ours from scratch. You may find you need to do that. Ours doesn't use directories.. We wildcard DNS from our database.