The MU forums have moved to WordPress.org

get sub-domain (5 posts)

  1. erinther
    Member
    Posted 17 years ago #

    Hi,
    I've a wmpu installation in where I user sub-domain option. Now I try to get"subdomain" string to use in a script. I mean how I can get "thisblog" in:
    http://thisblog.mysite.com

  2. lunabyte
    Member
    Posted 17 years ago #

    To do exactly what with?

    There's many ways to do it, depending on what you need to do with the data.

    Going to need more details on this one.

  3. erinther
    Member
    Posted 17 years ago #

    I have created a php file inside wp-admin folder and will use it to include another file in media.mysite.com/thisblog directory. I need "thisblog" string to put in my include path.

  4. lunabyte
    Member
    Posted 17 years ago #

    You could either explode the SERVER variable for host by the . and then choose the 0 key of the array produced, or you could use the blog_id to run the get blog details function and then use the generated array key from that.

  5. erinther
    Member
    Posted 17 years ago #

    Thanks Lunabyte, but I would really appreciate if you come with an example. I'm afraid to do something wrong! Thanks

About this Topic

  • Started 17 years ago by erinther
  • Latest reply from erinther