Support » Networking WordPress » Site aliases from within WP 3.0

  • Resolved davidem

    (@davidem)


    Hi all,

    I just migrated to WP 3.0 and immediately wanted to make work of the multisite options. Everything works fine, I just have a question:

    Is it possible to create subdomain aliases in wordpress? For example, I have the following setup:

    main domain: domain.com
    site1: site1.domain.com
    site2: site2.domain.com

    I would like to point ‘whatever.domain.com’ to site1.domain.com, which I used to do with a simple serveralias in apache. But that has been replaced by the wildcard 😉 Do I have to tinker with the always amazing apache rewrite rules, or does anyone know a more simple solution, preferably from within WP?

    Thanks,

    David

    /edit:
    I found out that to make an ‘alias’ which points to the main domain, you should simply put the name in the ‘Banned Names’ in SuperAdmin > Options.

Viewing 15 replies - 1 through 15 (of 25 total)
  • If you put a defined subdomain in your httpd.conf file, it should supersede the wildcard.

    So if you define foo.domain.com, then that will take precedence over *.domain.com

    Is that what you mean?

    Hi Mark & ipstenu,

    I already have the wildcard setup in my httpd.conf, but since I did that, it is no longer possible to create ServerAliases for specific subdomains created in WordPress.

    If I do create a ServerAlias in httpd.conf, it would only make it point to the general domain / main WP domain which I called ‘domain.com’ in my example.

    Another possibility would be using mod_rewrite in httpd.conf to ‘translate’ the alias in an existing subdomain, but that isn’t the most easy option and is not an option for my customers, as they can’t edit httpd.conf.

    That’s why I’m asking if it is possible to create aliases from within WP.

    I already have the wildcard setup in my httpd.conf, but since I did that, it is no longer possible to create ServerAliases for specific subdomains created in WordPress.

    Well right, you’re talking using the wildcard for all WordPress subdomains and manually created aliases for NON WordPress domains.

    Well, no, because non-WP domains/subdomains I can catch with separate VirtualHosts in Apache… I’m talking about aliases for subdomains created in WP.

    To put is simple: I want blaat.domain.com and blabla.domain.com to go to the same WP site. How do I do that with WP3.0 and without Apache redirects, preferably within WP itself?

    Wait … I think I understand what you want:

    Do I have this scenario correct?

    WordPress installed at domain.com
    SubSite Foo at foo.domain.com
    ALIAS for Foo (Bar) is bar.domain.com

    foo.domain.com is handled by the wildcard.

    You want bar.domain.com to point foo.domain.com which doesn’t actually exist because it’s a wildcard?

    Yep, that’s indeed what I want 😉

    /edit: just a side-question: was my initial quesion that cryptic? If so, I need to work on my ehm… explaining skills 😉

    Not on a re-read, but … I think since most of us are used to hearing the other question, we didn’t think. That’s my excuse!

    I would say DON’T use the wildcard for that domain, and instead specify that foo.domain.com points to domain.com (which SHOULD still let WP handle it) and then point bar.domain.com to foo.domain.com?

    But I’m not 100% sure that would work. You may need to look up how to point server aliases to other aliases :/ I almost want to say it’s more an apache issue than an WP one.

    I almost want to say it’s more an apache issue than an WP one.

    It is.

    I don’t think it’s possible myself. Definitely not in the backend of WP.

    hmm, too bad… Because for me it is not a problem to tinker with Apache’s files, but it is for the people who will use these blogs eventually.

    What’s the chance that it will end up in a future release? 😉

    Seeing as it’s sort of a function of how any web app would react to that situation, I’m not sure that WordPress could fix it. Any fix for Apache would likely break on IIS.

    To be honest I don’t agree with the conclusion that it is an issue with Apache. Apache works fine and is set up correct, according to the setup guide from WordPress.

    The wildcard in httpd.conf sends all subdomain-requests to WordPress, so it is up to WordPress to interpret those requests. At this moment, if it doesn’t recognize a subdomain, it asks if a new site should be created. It shouldn’t be that difficult to make it understand aliases.

    And as I stated before, it already works if you want an alias for your main domain, by just make an entry in the ‘Banned Names’ section of the superadmin options.

    And as I stated before, it already works if you want an alias for your main domain, by just make an entry in the ‘Banned Names’ section of the superadmin options.

    Somehow I missed that. o.O

    The problem there is WP isn’t saying banneddomain = subdomain2, it just says ‘Any domain here isn’t allowed to be a subdomain goes back to main.’

    Maybe you could code up an aliases plugin that says ‘Sub1 = sub2’? I know I can do that in cPanel, which is my workaround for this.

    Maybe you could code up an aliases plugin that says ‘Sub1 = sub2’?

    Lol… Let’s have a look at ‘Hello Dolly’ 😉

    It would be similar to the banned name check, just instead of defaulting to main, it would allow you to chose (say from a dropdown of defined subdomains)?

    That would actually be pretty awesome. Certainly plugin territory, since I don’t know why most people would want to do this. Why do you, out of curiosity?

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Site aliases from within WP 3.0’ is closed to new replies.