WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
domain mapping to subdirectory (24 posts)

  1. ddarby14
    Member
    Posted 3 years ago #

    Beating my head on this. I've been through forums, andrea_r's posts/slideshows and the docs several times.

    Seems most people are using subdomain installs on this though, according to the plugin, it 'recently' began supporting subdirectory installs.

    If you can help here or point me in the right direction, I'd be really grateful.

    My understanding is that users can modify their A/Cname record to point to our site "mybasedomain.com", then under Tools | Domain Mapping, map "myblogdomain.com" to "mybasedomain.com/myblog" and booyah - great joy.

    Except I'm not feeling the joy. In doing so, "myblogdomain.com" in the browser is in fact landing at "mybasedomain.com".

    Excellent. It 'seems' to me that the DNS for "myblogdomain.com" is doing it's part and getting the user to our server.

    However, why isn't it finishing the last step and A) at a minimum, redirecting them to "mybasedomain.com/myblog" or B) ideally, showing "myblogdomain.com" in the URL while displaying "mybasedomain.com/myblog" content?

    Here's what I have at the bottom of wp-config.php:

    define('WP_DEBUG', false);
    define ('WP_ALLOW_MULTISITE', true  ) ;
    
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'lifemapp.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** WordPress MU Domain Mapping plugin */
    define( 'SUNRISE', 'on' );
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    Again, really appreciate ANY direction/pointers to solve this.

  2. ddarby14
    Member
    Posted 3 years ago #

    Also, under Super Admin | Domain Mapping Configuration, we're running with:

    CHECKED
    2 (Permanent redirect)
    3 (User domain mapping page)
    
    UNCHECKED
    1 (Remote Login)
    4 (Redirect administration pages)
    5 (Disable primary domain check)
  3. according to the plugin, it 'recently' began supporting subdirectory installs.

    'recently' as in 2009. (I think).

    the fact you;re using subdomains should not be an issue.

    UNCHECKED
    1 (Remote Login)

    And what happens if you check this?

    And is the domain you mapped the Primary domain?

  4. ddarby14
    Member
    Posted 3 years ago #

    thx Andrea - I saw your post early last year about subdirectories, so I figured 'recently' was long time ago! ;)

    And what happens if you check this?

    It won't save 1 unless I check 4 at the same time so I checked both. In checking both 1/4 (so that 1-4 are all checked now) and I'm seeing the same results.

    Also, I have under the site "myblog", Tools | Domain Mapping:

    Primary	Domain
       x	http://myblogdomain.com
    	http://mybasedomain.com/myblog
  5. ddarby14
    Member
    Posted 3 years ago #

    Andrea, in my original post, I had my real domain replaced (DOMAIN_CURRENT_SITE) but when the code didn't post correctly, I re-pasted and forgot to replace the real domain again. Would you be able/available to modify that to "mybasedomain.com"? Really appreciate it and sorry for the trouble.

  6. ddarby14
    Member
    Posted 3 years ago #

    Registrar info (if helpful) currently has both A and CNAME pointing to mybasedomain.com:

    myblogdomain.com   Address Record (A)   xxx.xxx.xxx.xxx
    localhost. myblogdomain.com   Address Record (A)   127.0.0.1
    myblogdomain.com   Mail Exchange Record (MX)   preference=10, host= myblogdomain.com.
    *. myblogdomain.com   Canonical Name (CNAME)   mybasedomain.com.

    where xxx.xxx.xxx.xxx is the IP for mybasedomain.com

  7. Where are you hosted & what kind of control panel do you have?

  8. ddarby14
    Member
    Posted 3 years ago #

    Host is Verio on a robust managed private server - no cpanel, they have a custom dns panel with multiple IPs and we manage the vhost manually with root access. Can do wildcards, but don't think we need that for our usage - subdirectories.

  9. no, you don;t need wildcards. :)

    Did you do a ServerAlais from myblogdomain.com to mybasedomain.com?

  10. ddarby14
    Member
    Posted 3 years ago #

    ServerName	mybasedomain.com
    ServerAlias	*.mybasedomain.com

    This is the only vhost config for these 2 domains. Really hoping (my understanding) that I do not have to do ServerAlias for myblogdomain.com manually - but instead users will be able to add their own via the plugin and need nothing from the server side. I'm guessing you're just checking to trace the flow though. :)

    Thanks again for working through this with me. It really has me stumped.

  11. Yes, you DO need to add a ServerAlais. That's how the server knows where to send it. ;)

    (That's why the instructions say "park it in cpanel" as that's what the cpanel parking does. make it a server alias.)

    Alternatively, if you're doing these in bulk, check the vhost section for a named wildcard host. It should send all domain requests to the folder where WordPress is installed.

  12. ddarby14
    Member
    Posted 3 years ago #

    Hey Andrea - sorry for the delay, slammed this past week. I had 1 domain working without the alias, one with. I need to isolate my settings/dns, wait for propagation and test. Still thoroughly confused and appreciate your guidance once I report back to you.

    Thanks.

  13. markb1439
    Member
    Posted 3 years ago #

    I'm still confused...do we need to set up an alias for every user? I thought they are able to handle their own domain mapping via the plugin...and if they enter a domain in the plugin, that is how the server knows where to send the traffic (by getting those details from the plugin).

    Thanks,

    Mark

  14. and if they enter a domain in the plugin, that is how the server knows where to send the traffic

    No.

    By entering their details in the backend of WordPress, then WordPress knows what blogs to send people to.

    You still have to set up things on the server side, so when domain requests come in for that domain, to your server, then your server sends it to your WordPress install.

    THEN the plugin kicks in.

  15. ddarby14
    Member
    Posted 3 years ago #

    Andrea - is the domain parking (server side) a necessity only when having a shared IP environment or shared hosting with multiple wordpress installs?

    We moved servers and dns hosts during this exchange which made things crazy. All is settled now. Now we have a cloud of servers now each with unique IPs. All I am doing to get the plugin to work now, is what I expected/wanted. No parking/vhosts changes, just add the Domain Mapping entry for the desired blog(subdirectory), then:

    1) CNAME record pointing to our wordpress install (we had to include the "www." here which added to part of our problem before.)

    Working Example (**take out the http://, forum here is adding that**):

    CNAME    www.    www.wordpressinstall.com

    Before we were using this which failed even though our WordPress install/site uses the non-www of http://wordpressinstall.com:

    CNAME     www.     wordpressinstall.com

    2) Since we're using GoDaddy now exclusively for our registrar/dns, we've also learned that we cannot do a wildcard CNAME with them (with some dns providers you can) to route the http://mappedsite.com the same as http://www.mappedsite.com. If we REALLY want this, we had to send the A record IP to our wordpress install IP.

    We are employing this only for our domains as we've grown accustomed to site URLS without the www. We will condition our clients to use the www. CNAME only.

    Both 1 and 2 worked as standalone solutions after adding a Domain Mapping entry in the WordPress plugin. No server side parking required.

    That was what I was expecting, and sounds like Mark too - complete self-management by the enduser.

    However, we have not yet tested anything with multiple IPs (or same IP wordpress installs) on a single server yet. We're hoping to do that this weekend.

  16. ddarby14
    Member
    Posted 3 years ago #

    The other thing too that was blocking us before, in the Domain Mapping area for the blog/subdirectory, when using the CNAME only DNS, we were using "mappedsite.com" as our entry which failed.

    If using CNAME only, we had to put "www.mappedsite.com" in our Domain Mapping entry.

    If using both CNAME and A record, then we had to add both the www. and non-www. At that point, it's up to personal preference which one to make the primary/default.

    But the plugin works like a dream with that configuration/knowledge.

  17. is the domain parking (server side) a necessity only when having a shared IP environment or shared hosting with multiple wordpress installs?

    Domain parking is a cpanel term. If you're on another host, they may call it something different. In Apache, you're making a serveralias.
    If you're on a dedicated box, then the best way is to have a wildcard named host.

    So the parking bit is really "it depends on your web host".

    The big key to this - which you already figured out - is configuring the server itself to send domain names to the proper location. Once the hits the server, it sends it to the wordpress install and then the plugin kicks in.

  18. ddarby14
    Member
    Posted 3 years ago #

    I think the parking (or serveralias or whatever the flavor) is the catch for people, at least it was for me, maybe Mark. Not in the terminology or employment, but in terms of added effort/management.

    We're not using serveraliases at all, so therefore the plugin is working as I expected - whereas client can come and go with using our services/pointing their own domains, we never have to think about it.

    We're also not using wildcard host (I believe that is only for the subdomain version and we're only using subdirectory).

    I really would not want a setup in which, say I get 1000 users who add 1000 domains and requires our team to add 1000 serveraliases - oy, that is a nightmare. Our goal is always to create a self-managed system so that we (the host/supplier) are never a hurdle/manager for clients. :)

    With the way we have it setup (still guessing it's because only 1 install per server or IP), our team does nothing at all in the process.

    It's all up to client to a) add CNAME (or A) record and b) add matching entry to Domain Manager.

  19. ddarby14
    Member
    Posted 3 years ago #

    Hopefully, this is helping to clarify. Even though we aren't using the serveralias Andrea, you were a HUGE help in me sorting through this to a working solution. I don't think I've said it yet (sorry) but THANK YOU! :)

  20. We're not using serveraliases at all, so therefore the plugin is working as I expected -

    you are, you;re just unaware of it. ;) *Something* on your server points all requests for client domains, or in your case, the CNAME you gave them, to your main wordpress installs.

    that;s a serveralias.

    We're also not using wildcard host (I believe that is only for the subdomain version and we're only using subdirectory)

    You're thinking of wildcard subdomain. Wildcard host is different.

    And exactly what you would use for adding 10000 domains.

    It's all up to client to a) add CNAME (or A) record and b) add matching entry to Domain Manager.

    Right, because you either have the serveralias in place or (or maybe and) you also have a wildcard named host in apache.

    This has been done for you already by your webhost or your web team. *Something* in your server setup has already been domain so the domains go to the right place and you don't have to park each one for your clients. That's all I'm clarifying, so people reading along get this.

    The only reason people have to park each domain in cpanel is if they are on a shared host. that is it.

    And you're welcome. ;)

  21. ddarby14
    Member
    Posted 3 years ago #

    you are, you;re just unaware of it. ;)

    Oh how true that usually is! I'm not tech smart, but I make up for my stupidity in determination/stubbornness. (and of course, with great people like you) ;)

    Yeah, that's why I think that using a dedicated server is what is making this tick for us. All incoming requests by default are going to this main domain. When we test this weekend on another box with 2 main domains/wp network installs and CNAMEs coming in, I expect it to blow up.

    Lesson for me (and maybe others) is small cost for extra box on cloud/extra IPs is great payoff for not managing serveraliases individually.

    You rock. ***bows***

  22. markb1439
    Member
    Posted 3 years ago #

    I'm still confused, as the plugin seems to work with users just entering their domains via the plugin (and, of course, making the appropriate change at their registrar).

    Our WordPress multisite install is set up in a cPanel/WHM account. The WordPress network is on a dedicated IP address. So, when users point their mapped domain at that IP address by modifying the A record at their registrar, their requests go right to the WordPress installation. Then, if they've entered that same mapped domain in the plugin, WordPress takes that traffic and sends it to their blog.

    So does our dedicated IP (and its A record) achieve what you were talking about? And do we need to do anything else? I can't imagine setting something up for each client and each domain they want to map, as that would defeat the purpose of giving them the ability to do that themselves.

  23. So does our dedicated IP (and its A record) achieve what you were talking about? And do we need to do anything else?

    You're good. :) The server alreayd does what you need, you do not have to do anythign else.

    I'm just explaining *why* that is.

    The WordPress network is on a dedicated IP address. So, when users point their mapped domain at that IP address by modifying the A record at their registrar, their requests go right to the WordPress installation.

    And this is why it works.

    (I actually covered this in my ebook.)

  24. markb1439
    Member
    Posted 3 years ago #

    Got it, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic