Auto subdomains

Discussion in 'Apache' started by bbrez1, May 26, 2008.

  1. #1
    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
     
    bbrez1, May 26, 2008 IP
  2. bbrez1

    bbrez1 Banned

    Messages:
    208
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anyone? Thanks :)
     
    bbrez1, May 26, 2008 IP
  3. Randombase

    Randombase Peon

    Messages:
    224
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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):
     
    Randombase, May 26, 2008 IP
  4. bbrez1

    bbrez1 Banned

    Messages:
    208
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This doesn't work for me :(
     
    bbrez1, May 27, 2008 IP
  5. bbrez1

    bbrez1 Banned

    Messages:
    208
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    bump... would need this ASAP. I will pay if anyone would help me with this.

    Thanks
     
    bbrez1, May 28, 2008 IP