Domain Mapping

Discussion in 'Server Operation' started by fannar, Jun 4, 2007.

  1. fannar

    fannar New Member

    I were wondering if anyone could help me with domain mapping something like wordpress.com, stikipad.com, shopify.com and many others are offering.

    Most of them ask you to use CNAME, which I think I would prefer over asking my customers to use my nameservers.

    What I'm looking for is to map mydomain.com to subdomain.domain.com. I were just wondering what you think is the best solution regarding the server side, PHP side is OK.

    I will be using Apache. How should the config file be configured? :)

    Hope to hear some comments on this !
     
  2. fannar

    fannar New Member

    Anyone? Please?
     
  3. falko

    falko Super Moderator ISPConfig Developer

    So you want subdomain.domain.com to point to domain.com? Just create a CNAME or A record, and in domain.com's vhost configuration you must add subdomain.domain.com to the ServerAlias line. Restart Apache afterwards.
     
  4. fannar

    fannar New Member

    Well its more like this:

    1) someblog.blogs.com wants to set up his own domain for this blog
    2) He registers myownblog.com
    3) He creates CNAME for myownblog.com (which I'm not sure how to do, wheras most hosting companies just allows subdomains to be CNAMEs??)
    4) The CNAME points to someblog.blogs.com

    The question is then, do I need to add myownblog.com as ServerAlias for blogs.com ? And then map that in my code than when its myownblog.com it should use the data from "someblog" ?

    What I'm not getting is how does wordpress.com allow your own domain, do they add it to their Apache config file as ServerAlias? It sounds very stupid to me. But maybe the only way ?

    Make a script to add the domain as ServerAlias, reload the config and then read the HTTP header and find out this domain is mapped to some user?

    So it should be:
    myownblog.com CNAME someblog.blogs.com

    In blogs.com config:
    ServerAlias myownblog.com

    Mysql:
    myownblog.com is owned by someblog

    Thanks a lot.
     
  5. falko

    falko Super Moderator ISPConfig Developer

    You need to add myownblog.com to the ServerAlias directive, but I don't know what you have to change in Wordpress.
     
  6. fannar

    fannar New Member

    Ok. But what is then the best way to add a CNAME to myownblog.com topdomain ? If the hosting provider just allows subdomains to be added as CNAMEs ?
    That is this works:
    blog.myownblog.com CNAME someblog.blogs.com

    So when someones goes to blog.myownblog.com it is aliasing someblog.blogs.com. But if I would like myownblog.com be aliased to someblog.blogs.com, some ideas?

    Thanks.
     
  7. fannar

    fannar New Member

    Also what I don't get, if I'm adding ServerAlias for each domain for each user to the config file, won't it be very hard to allow users to change their domain ?

    User goes into blogs.com control panel, adds myownblog.com as his domain for someblog.blogs.com. Blogs.com adds myownblog.com as ServerAlias for blogs.com? User adds CNAME to myownblog.com (to blogs.com or someblog.blogs.com, what is the different?) And then blogs.com matched that myownblog.com should be someblog.blogs.com?

    You get my point ?

    Thanks.
     
  8. falko

    falko Super Moderator ISPConfig Developer

    Then you'd either have to negotiate with your provider, or set up your own nameservers.
     
  9. fannar

    fannar New Member

    Ok thanks Falko

    But are you telling me that all these services is adding ServerAlias to their domain config files ? It seems quite supid to me to reload Apache after each domain map.
     
  10. falko

    falko Super Moderator ISPConfig Developer

    You can try wildcards (*) in the ServerAlias line, but I'm not sure if this works.
     
  11. fannar

    fannar New Member

    Well, I don't know why I didn't think of this before, but I solved this problem by creating new site file under sites-available for each new mapping. In this file I set ServerName to someblog.blogs.com and ServerAlias to blog.myownblog.com and also made some mod_rewrite with perm. redirect from someblog.blogs.com to blog.myownblog.com.

    Any thoughts if this shouldn't be ok? (maybe regarding google bot?)

    thanks.
     

Share This Page