EXCLUDE A SUBDOMAIN FROM WPMU AND USE IT FOR MAIN SITE

Hi everyone.

I installed a WPMU in my main domain like http://domain.com. New blogs will create on sub domain after register like http://new.domain.com. I used "User Pro" plugin for manage new users and plans.

Now I want to create a front-end panel for registration, login, user sites list, user profile, support system and etc. But I need use a subdomain for this, like http://my.domain.com. I create a subdomain in my host and it's work fine. I created an index.php in subdomain folder and add this code to integrate with wordpress:

<?php
$_GET['page_id']=2; /* Or any page id */
define('WP_USE_THEMES', true);
require( '../wp-blog-header.php' );
?>

This code worked in single installation but WPMU doesn't allow me to use subdomain and when I want use this subdomain for wordpress pages, redirect me to register for new blog or if I add subdomain to "Banned Names" redirect me to home page.

I posted this topic on members forum, but I think it's difficult topic.
I really need help about this :disappointed:

  • Rupok

    Hi Morteza Rezvani

    Hope you had a wonderful day.

    Well, it's really a complex process, and I'm talking with our developers about how we can do this, or if this is possible in Multisite.

    However, can you please send me message FTP with access credentials through our secure contact form here: https://premium.wpmudev.org/contact/ so we can have a better look at this?

    Subject: "Attn: Rupok"
    - FTP Username
    - FTP Password
    - FTP Host
    - Link back to this thread for reference
    - Any other relevant URLs

    Select "I have a different question" for your topic. This and the subject line ensure that it gets assigned to me.

    Moreover, would you mind allowing Support Access so we can have a closer look at this?

    To enable support access you can follow this guide here:
    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Have a nice day. Cheers!
    Rupok

  • Rupok

    Hi Morteza Rezvani

    Hope you had a wonderful day.

    It's weekend and I can't see our developer online who is the best for this type of issues. But I've pinged him already and I believe, he can give you best idea regarding this.

    Please keep in mind, our developers work round the clock and they have to deal with lots of critical issues and other things. So it may take a little while for them to check this and provide a feedback.

    If you need an urgent solution, you can hire a developer from our Jobs Section here: http://premium.wpmudev.org/jobs/ . Please remember, developers found in our Jobs Section are not associated with us. So communicate with them well before you make any payments to them.

    Have a nice day. Cheers!
    Rupok

  • Rupok

    Hi Morteza

    Hope you had a wonderful day.

    I'm so sorry for the delay from our end. Actually we have a queue to maintain, threads come first, get replies first. But I understand your issue is really important and I'm pinging our developer personally again so he prioritizes your task. And from now on, I'll try to respond on this thread as soon as possible. Though our developer will work on this, you still know he has some other things to do at the same time, but when you hire a developer, you can give him a timeframe and push him to do it faster. That's why I suggested you to hire a developer from our Jobs Section.

    About your issue, I really tried to fix it myself, I searched in Google, studied couple of things, but your issue is unique and nothing really helped in this case. To be honest, I never did showing content of one site on another php page by calling WP Header and WP_USE_THEMES define constant. This could be possible by URL Masking, but your approach is completely different. So I've flagged our Domain Mapping plugin developer as he might be able to put some valuable feedback on this.

    Trust me, I've searched through hell lot of articles and sites, but all of them are talking about how you can pull/show/manipulate content *inside* WordPress instance, not outside. You mentioned this is a difficult issue, and I second that. So you need to give us some time for investigating. I'm confirming you, we won't take more time than it actually requires. And I'm not sure what should be the best approach for doing this in Multisite. I'm waiting for our developer feedback and we will work, if required, as soon as our developer says something regarding this.

    I really appreciate your patience.

    Have a nice day. Cheers!
    Rupok

  • Morteza Rezvani

    Hi Rupok

    I really thank you for your cooperation. In fact I research and study a bunch of document before open a ticket and trust me I could not find any solution for this issue. So I open a ticket in here because I belive you are the best in wordpress and it's true.

    I know this issue is unique and really difficult. So I think hiring is not a good idea, because I don't know anybody can solve this issue.

    Anyway, I waiting for your developers answer.
    Thank you Rupok for everything.

  • Sam

    Hi Morteza Rezvani

    For these kinds things when a directory of path is in control of WP, you cant to either use htaccess or nginx directives or use sunrise.php dropin, WP hits sunrise.php after bootstrapping in index.php, so basically this is where you can do lots of things like setting or modifying global variables or making WPMU believe that a website/subsite exists or not. Have a play with it and let me know if there is anything specific I can help you with.

    Cheers,
    Sam

  • Morteza Rezvani

    Hi Sam

    Thank you for your help. But could you please explain more about your idea.
    Let me describe my issue with "subdomain".
    For more than 3 years, I used wordpress integration to create a nice user panel for diffrent situation in wordpress single site.

    Actually it's really easy to do and you can read more about this in Wordpress Codex. Usually I create a subdomain and put an index.php on this and load an specific page on this subdomain by following code:

    <?php
    $_GET['page_id']=PAGE_ID;
    define('WP_USE_THEMES', true);
    /** Loads the WordPress Environment and Template */
    require( '../wp-blog-header.php' );

    After that I build my user panel with "Theme My Login" and put a short code on that page. So users can access to user panel on subdomain. Like this: "user.domain.com"

    I use this code for my network in both of network installation( Sub-Domain and Sub-Directory ), but every time when I loaded user panel subdomain, wordpress redirect me to home page and if site-pro be enabled, redirect me to create new blog.

    Now I want build a wordpress network(subdomain installation) with site-pro. I want to create an user panel for my network on subdomain. Something like this:
    - domain.com for main site
    - newblog.domain.com for users site
    - user.domain.com for main site's user panel( to control users login, register, profile, site list, payment and etc...)

    So I accept any idea for this situation.

    Best Regards,
    Morteza

  • Morteza Rezvani

    Hi Rupok

    Finally I found a way to make this structure.
    I write a simple note for other users that need it.

    At the first, I explain my scenario:

    I want to have my main site on a sub domain like this: my.domain.com or panel.domain.com or any other things, and users can add their site on site1.domain.com or site2.domain.com.
    I need to this structure because, I made a front-end dashboard for my wordpress network. So each user can access to Profile, Support, FAQ, Help, Manage Sites, Submit New Site and etc on my.domain.com.

    To have this structure:

    1. Install wordpress network on my.domain.com.
    2. Install WPMUDEV Dashboard plugin.
    3. Install Multi Domains and Domain Mapping plugins.
    4. Add domain.com to Multi Domains setting and set visibility to Public.
    5. Edit my.domain.com on Multi Domains setting and set visibility to Private.
    6. Add new site like main.domain.com or any other name.
    7. Go to new site dashboard(in my case: main.domain.com) and map domain.com to new site(in my case: main.domain.com).
    8. Go to network dashboard settings and add my and new site address(in my case: main) to Banned Names.

    Thats it :slight_smile:

    Now users can access to main.domain.com by domain.com and they can access to login, signup, and new dashboard from my.domain.com.

    It's look like complicated, but it's not really and just should try it one time.

    To create login, register and profile pages, I used TML plugin.

    I hope be useful for other users.

    Cheers!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.