The MU forums have moved to WordPress.org

Manually Creating Subdomains (26 posts)

  1. channer
    Member
    Posted 16 years ago #

    Hi,

    I have searched the forums but to no avail have I found a topic that covers the exact issue I am having.

    I do not have access to have wildcard dns and before I use the option of subdirectories for blogs, I was wondering if there was one other option. Could I manually create subdomains in my hosting panel and then also add the blog within the admin account for Wordpress? Would this not work the same way as wild card dns? Users on my site will cannot sign up for blogs, they need to be created by me (the admin). I have used this route but when I click to view the posts of my subdomain blogs, it is telling me "Bad Request". However, the blog on my main account does in fact work.

    Thanks in advance.

    Greg

  2. channer
    Member
    Posted 16 years ago #

    Can anyone out there help me please?

  3. andrewbillits
    Member
    Posted 16 years ago #

      Would this not work the same way as wild card dns?

    Nope. The subdirectories you are manually creating are most likely pointing to their own directory.

    Thanks,
    Andrew

  4. channer
    Member
    Posted 16 years ago #

    Hi Andrew,

    Thanks for your reply. I am manually creating subdomains which point to the root directory. I am not dealing with subdirectories. Should this not work the same way as if I were to have wildcard subdomains?

    Thanks again,

    Greg

  5. andrea_r
    Moderator
    Posted 16 years ago #

    No, they do not. Nothing lives in the subdomain folder on the server. So to recap:

    "Could I manually create subdomains in my hosting panel and then also add the blog within the admin account for Wordpress? Would this not work the same way as wild card dns?"

    Nope, it doesn't work that way.

    If you can't get wildcards turned on for your domain, then use subdirectories.

  6. channer
    Member
    Posted 16 years ago #

    Hi Andrea,

    I'm not sure if I understood your response correctly. If I manually create subdomains can't I just point them to the correct directory so that it would act the same way as wildcard subdomains? Actually, if you could let me know where the wildcard subdomains point on the server, that would solve my problems.

    Thanks!

    Greg

  7. lunabyte
    Member
    Posted 16 years ago #

    Think of everything in MU as operating like a permalink.

    No directories exist for each blog, etc. (excluding uploads, but that's a different story). Meaning: everything is virtual, and you can't just point a subdomain at a directory with the same name and call it a day.

    Everything is controlled through /index.php no matter if it's a subdomain or subdirectory install.

    Oh, and if this is for only a handful of blogs, MU is pretty much overkill.

  8. andrea_r
    Moderator
    Posted 16 years ago #

    "If I manually create subdomains can't I just point them to the correct directory so that it would act the same way as wildcard subdomains?"

    No, you can't. :) That's what I've been saying. The subdomains/subdirs don't actually exist. They are virtual, either option. They live in the database and all the magic happens between requesting the page and having it displayed.

    "Actually, if you could let me know where the wildcard subdomains point on the server, that would solve my problems."

    Like luna said, the wildcard points to the index of the site. The htaccess file then interprets this and gets the info directly out of the database. The results files do not appear anywhere on the server. They only *look* like they do.

    If you want to just create the accounts yourself, the latest code has "disable new accounts" in the options. Then I think you can still create the blog in the backend. Use subdirectories. They are still virtual, but you don't need to edit any files.

    There is no way you can make subdomains work without using the wildcards. That is the whole way they are created.

  9. kchrist
    Member
    Posted 16 years ago #

    Yes, you can, actually. There is no difference between subdomains explicitly defined in DNS and subdomains via wildcard DNS. None. As long as these subdomains are pointed at the same site (ie, the same Apache VirtualHost) as the WPMU installation, it will work fine. This is exactly what the original poster is asking. He never said anything about pointing the newly-created subdomains to different directories.

    There's nothing magic about wildcard DNS; you just need to get all your subdomains pointing at the right place by whatever mechanism you need. I do this myself via the hosts file on my laptop for development. It works just fine.

  10. andrea_r
    Moderator
    Posted 16 years ago #

    I don't think that's what he was asking though. If he could edit his hosts file, he could put a wildcard in there, and yes, I know you can put a subdomain in there and work it just fine. The wildcards don't work locally on windows and this is what you need to do for that.

    This is what he originally asked though:
    "I do not have access to have wildcard dns and before I use the option of subdirectories for blogs, I was wondering if there was one other option. Could I manually create subdomains in my hosting panel and then also add the blog within the admin account for Wordpress?"

    to me, this is basically asking if he can go into Cpanel and set up a subdomain and have it point to the right blog in MU, without touching any apache files.

    "He never said anything about pointing the newly-created subdomains to different directories."

    Yes, he did.
    "If I manually create subdomains can't I just point them to the correct directory so that it would act the same way as wildcard subdomains?"

    I'm not trying to argue with you, I'm just making sure he has the correct info. If you can explain to him how to get a subdomain working in MU *without* touching the hosts file, feel free.

  11. kchrist
    Member
    Posted 16 years ago #

    The hosts file thing was just an example to demonstrate that wildcard DNS, in and of itself, is not required as long as the hostname points to the right web site. I know he's not asking about doing this.

    If I manually create subdomains can't I just point them to the correct directory so that it would act the same way as wildcard subdomains?

    I'm reading "correct directory" as "the directory WPMU is installed in", as that would be the only possible "correct" directory in this context.

    To the original poster: If whatever control panel you're using will let you assign multiple subdomain names to a single web site/directory (ie, a single WPMU installation), it should work fine.

  12. channer
    Member
    Posted 16 years ago #

    Hi Andrea and kchrist. Thanks for your replies and help thus far.

    kchrist, you are correct when you state that I have access to assign multiple subdomains to a single web site/directory. My hosting panel will allow me to create a subdomain and point it to any directory on the server. I have installed my mu blog in mydomainname.com/blog and have attempted to point my subdomain to mydomainname.com/blog but when I attempt to access the blog, it does not display correctly (no graphics, just text). Furthermore, when I click on a blog post, it gives me an internal server error. I have also tr>ed pointing my subdomain to the root directory of my server. When I attempt this, the actual blog displays correctly with proper graphics but again when I click on a post, it gives me an internal server error.

    I'm sorry if I misconstrued my question. I do not have access to change configurations in apache and thus cannot create wildcard subdomains. However, I have unlimited subdomain creation capabilities allowing my to point these subdomains anywhere on the server.

    Thank you all again in advance.

    Greg

  13. lunabyte
    Member
    Posted 16 years ago #

    First bad thing: you installed it in a subdirectory. Install it in the root.

  14. channer
    Member
    Posted 16 years ago #

    I can't install it on the root. I have my main website on the root.

    Thanks,

    Greg

  15. channer
    Member
    Posted 16 years ago #

    subdomainname.mydomain.com/blog shows the blog in full form. However, subdomainname.mydomain.com/blog/2007/10/20/test/ gives me a bad request.

    I think this means that the subdomain is pointed to the right directory (root) but it is not reading the url correctly. Any suggestions?

    Thanks,

    Greg

  16. dsader
    Member
    Posted 16 years ago #

    Will this work? Install wpmu in the root of a new subdomain.

    Create a subdomain, ie "blogs".
    Cpanel creates the folder "blogs"
    Drop the contents of the wpmu install into it.
    Go to your blogs.domain.tld and wpmu install will kick in.
    VHOST=Yes

    Thus your blogs become:

    1: http://blogs.domain.tld
    2: http://userblog2.blogs.domain.tld
    3: http://userblog3.blogs.domain.tld

    Go back to cpanel and map userblogs to subdomains of a subdomain.

  17. channer
    Member
    Posted 16 years ago #

    hi dsader, my hosting panel will not allow me to create subdomains of subdomains.
    Thanks.
    Greg

  18. lunabyte
    Member
    Posted 16 years ago #

    "I can't install it on the root."

    Then you'll have to use subdirectories.

  19. dsader
    Member
    Posted 16 years ago #

    It doesn't work in my setup, either, as all subdomains have unique folders, thought it might get ya there, oh well.

    Subdirectories.

  20. channer
    Member
    Posted 16 years ago #

    kchrist,

    if you have a method or know what I'm doing wrong, could you please let me know? You seem to be the only one that has got the blogs working with manually creating the subdomains.

    Thanks.

  21. lunabyte
    Member
    Posted 16 years ago #

    "I can't install it on the root."

    Then you'll have to use subdirectories.

  22. kchrist
    Member
    Posted 16 years ago #

    channer: It really depends on your hosting company. If you can get the additional subdomains pointed to the same document root, it should just work. If you're having trouble getting that part set up through your control panel, you'll have to contact your hosting support. Tell them what you want is, in Apache terminology, "ServerAlias directives" for each of the subdomains you're adding. Your control panel may call them "pointers" or something like that. They should be able to steer you in the right direction.

  23. channer
    Member
    Posted 16 years ago #

    Thanks for your reply kchrist. I have installed my blog in the domain.com/blog directory. I have then pointed my subdomain to the root directory and the blog does display. However, when you click on a posting, it gives me an internal server error. I have tried pointing my subdomain to the /blog directory but this also does not work.

    Thanks again.

  24. kchrist
    Member
    Posted 16 years ago #

    Reading back over some previous posts it seems that subdomain blogs are not possible when WPMU is installed into a subdirectory rather than at the top-level of your domain. This appears to be your problem and it looks like there's no way around that.

    Maybe you could register another domain for this.

  25. lunabyte
    Member
    Posted 16 years ago #

    I said that twice, but it obviously isn't sinking in.

  26. channer
    Member
    Posted 16 years ago #

    Thanks kchrist and lunabyte and everyone that has helped me through this problem. I really appreciate all of your help. Lunabyte, I apologize if I was stubborn but I was really just trying to rectify the problem using my current setup. Thank you again.

About this Topic