I 've spent like 10h searching this on google and didn't find any usefull information. I'm creating a blog hosting web site and want to auto create subdomains, so when someone registers his blog his subdomain would be name.domain.com. I want to do it just like wordpress. I 've read that you need wildcard DNS enabled? So i did ask my hosting support to enable it and they did. Whats next? Thanks for your help
Long time ago I did this, but it involves using mod_rewrite. Found this snippet online: # Rewrite <subdomain>.example.com/<path> to example.com/weblog/<subdomain>/<path> # # Rewrite only if not already rewritten to /weblog/ RewriteCond $1 !weblog/ # Skip rewrite if subdomain is www RewriteCond %{HTTP_HOST} !^www\. [NC] # Extract (required) subdomain to %1 RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.nl(:80)?$ # Rewrite to /weblog/subdomain/URL-path RewriteRule (.*) /weblog/%1/$1 [L] Code (markup):