WordPress MU Domain Mapping 0.5

WordPress MU Domain Mapping is a plugin that allows the users of a WordPress MU site to use custom domains on their blogs.

It’s been a while since the last release but with the help of Ron Rennick, and many others (kgraeme – you kick ass at finding bugs!) I think the wait has been worth it. Changes since the last release:

  1. Works in VHOST or folder based installs now.
  2. Remote login added.
  3. Admin backend redirects to mapped domain by default but can redirect to original blog url.
  4. Domain redirect can be 301 or 302.
  5. List multiple mapped domains on site admin blogs page if mapped
  6. Bug fixes: set blogid of the current site’s main blog in $currentsite
  7. Bug fixes: cache domain maps correctly, blogid, not blog_id in $wpdb.
  8. and lots more bugs fixed and squashed.

There are still a few limitations however:

  1. Your WordPress MU site should be installed in the root of your server.
  2. It’s not possible to map a path on the new domain.
  3. You cannot map a domain on to the main blog in a folder install of WordPress MU.

Grab it from the page above, make sure you read the readme.txt as the plugin needs to be installed and configured correctly. You’ll also need to be familiar with concepts such as CNAME and A DNS records and how to configure your server correctly.

Please try it first on a test server. We have gone to extraordinary lengths to try to fix every bug we could but it’s always better to be careful when trying out new software.


116 Comments

Scott on November 26, 2009 at 5:21 pm.

Hi Donncha,
Thanks for creating such a wonderful plugin. I have one question does it work well with your other kick ass plugin WP-Super-Cache?

Reply

Donncha (1707 comments.) on November 26, 2009 at 5:32 pm.

It will work but unfortunately it won’t clear the cache when a new domain mapping is made so the old domain will show until the cache expires. Once that happens, the blog will redirect all the time.

Reply

Lazy (2 comments.) on November 26, 2009 at 6:24 pm.

wow, recognized this plugin now.. didn`t knew it before.. shame on me.

sounds like a really great MU Plugin

thank you very much for all your work

chris

Reply

charlie (11 comments.) on November 26, 2009 at 6:34 pm.

Thanks for this plugin!!!

Reply

charlie (11 comments.) on November 26, 2009 at 6:43 pm.

I find the big bug: I have two sites, and if the plugin installad, de secondary sites don’t load (redirect loop)

Reply

Donncha (1707 comments.) on November 26, 2009 at 8:39 pm.

Charlie – can you post more details to the forum thread I linked to above and we’ll try to track it down?

Reply

Scott on November 26, 2009 at 10:13 pm.

I am having the same problem. Redirecting between the original subdomain back to the mapped domain only happens when logged in getting an Unknown key arror the follwing parameters are being passed:
?action=login&dm=1ba50ab52754c394be8d5f659ffda771k=84a8b1b13840bd30a9ac63e0b4403b91&t=1246379060

Was using version Version: 0.4.3 prior without problems.

Reply

Ramoonus (19 comments.) on November 27, 2009 at 9:01 am.

With this new plugin i`m able to save about 25 mb per WP installation.
Not to mention, less login in and plugin update.

I own you a beer for this!

Reply

Jeremy Vaught (1 comments.) on November 27, 2009 at 9:11 am.

I have a blog that started to give me a url of “http://mydomain.com/?dm_gotoadmin=1&back=%2Fwp-admin%2F”when I try to login to wp-admin, and reverts me back to the blog with that url. I have to remove the plugin in order to log in.

My other blogs are fine, so not sure what is going on with this one.

Thanks!

Reply

Jorge on November 27, 2009 at 11:50 am.

I’m having problems with the plugin.

The blog: pruebas.blogs.upv.es has a domain mapping: hen.cc.upv.es

When I access to http://hen.cc.upv.es the main pages is showed fine. However if you click on any of the test posts you get a 404 Not found. Same problem with categories, tags, archives, and the rest of the links.

If I remove the domain mapping and access to http://pruebas.blogs.upv.es all the post are shown right.

Reply

Donncha (1707 comments.) on November 27, 2009 at 10:52 pm.

Is that the main blog on your site? That might be it.

Reply

Jorge on November 27, 2009 at 10:54 pm.

Nope, main blog is blogs.upv.es

Reply

Jorge on December 12, 2009 at 2:17 pm.

Ok, I manage to get it working changing the permalinks to ?p=xxx format. Is this the expected behaviour?

Reply

Jake (4 comments.) on November 27, 2009 at 10:41 pm.

Hmm… I replaced the old sunrise.php and domain_mapping.php – now all that shows up is a blank page (no html, etc). Thoughts?

Reply

Donncha (1707 comments.) on November 27, 2009 at 10:54 pm.

Anything in your php error log?

Reply

Jake (4 comments.) on November 27, 2009 at 11:42 pm.

I’m restoring the two files from a backup for now. Definitely not a smooth upgrade :)

Reply

Jake (4 comments.) on November 28, 2009 at 12:12 am.

Do you have the previous versions of the files available for download while my host retrieves the backups?

Reply

Jake (4 comments.) on November 28, 2009 at 12:20 am.

I found them via the codex, but that doesn’t seem to help. I can’t even get to the main blog. Everything is just an empty page. Is there something in the DB I can manually do to disable it from being used/called?

Reply

Donncha (1707 comments.) on November 28, 2009 at 9:49 am.

Sounds like a PHP error somewhere unfortunately. Comment out the SUNSHINE define in your wp-config.php. Does that help?

Jake (2 comments.) on November 28, 2009 at 11:10 am.

Donncha, did the new files modify any of the mapping information in the DB from previous versions – or did it add any info that wasn’t there to begin with?

Reply

Jake (2 comments.) on November 28, 2009 at 10:04 pm.

Donncha – problem resolved.

The problem was with the domain-mapping.php file. I mistakenly assumed that I could keep my backup version of that file (named domain-mapping.backup.php) within the same directory. Only to find out that whatever files are located within that directory will be loaded. So the old and new were both being loaded.

This caused me to go on a wild goose chase, because there were actually no errors logged. Hence the confusion.

At any rate, the new sunrise and domain-mapping files are in place and working as planned. Thanks again for the plugin.

Cheers,
–Jake

Reply

Puneet (1 comments.) on November 29, 2009 at 1:06 am.

Donncha — I have been gratefully using your plugin — version 4.3. When I upgraded to version 5.0, admin login does not work. It redirects me to https://blog.coverification.com/?dm_gotoadmin=1&back=%2Fwp-admin%2F&action=login&dm=5c1d070fb35d42d606a159ed4e23b814&k=0c1120d67e9ef5612d05ad0e4c7fbd82&t=1791696408 and shows a page with a message saying “Unknown login key”.

Reply

Blogs pédagogiques (1 comments.) on November 29, 2009 at 8:12 pm.

Hello Donncha,

Wow, thanks for this upgrade. What should we change if we want to test an install in a folder that is not the root folder ?

Reply

Donncha (1707 comments.) on November 30, 2009 at 10:33 am.

Blogs (Is that your real name? Really? Your parents were way ahead of their time if they gave you that name!) – anyway, you’ll just have to look through the plugin and adjust the code so it works the way you like it. There’s no simple “change this line …” solution here..

Reply

Sam Bern (1 comments.) on December 1, 2009 at 11:42 am.

This is a great plugin but I’m having some problems getting it to work. I’ve got wordpress mu installed on the domain sambern.co.uk. I’ve set up a sub domain stefan.sambern.co.uk and I’ve used the domain mapping plugin to map the domain stefangeorgiou.co.uk to the subdomain stefan.sambern.co.uk. However it goes into a loop of redirecting to all three domains. Have you got any ideas?

Reply

antoinet on December 2, 2009 at 8:15 pm.

Hi, I tried to run it wpmu domain mapping using nginx.
- wpmudomain.com is the main setup for wpmu
- I have another blog running at wpmudomain.com/anotherblogusingwpmu
- domain.com is a second domain and I’d like having a blog on it using wpmu

Problem:
When entering domain.com, it gets redirected to wpmudomain.com.
Any idea of what can be wrong?

domain.com.conf contains the following:
server {
listen 80;
server_name domain.com *.domain.com;

access_log /var/log/domain.com ;
error_log /var/log/domain.com_error;
location / {
root /var/www/wpmudomain.com;
index index.php;
if (!-e $request_filename) {
rewrite ^.+/?(/wp-.*) $1 last;
rewrite ^.+/?(/.*\.php)$ $1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
}

}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/wpmudomain.com$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
}

Thanks!

Reply

Richard W. Matthews (2 comments.) on December 5, 2009 at 4:06 am.

Hey Donncha,

First off thanks for all the fantastic work you do… I love WPMU and this domain mapping plugin… save me loads of time, energy, and space.

I’ve got one question though. When or how will we be able to use this on a WPMU install that’s not in the root directory of my web-server. I’ve got several WPMU installs that must be separate because they are Social sites that use Buddypress. Sadly, all but one of them must be in sub-folders on my web-server. So I can only use domain mapping on one WPMU install… that just makes me pouty inside… cause it’s such a great plugin.

Also, is this going to be a WP Core feature when you merge WP and WPMU or will it remain a plugin?

Reply

Donncha (1707 comments.) on December 5, 2009 at 7:06 am.

Richard – it’ll happen when it’s done, but honestly, you have all the same source code I have so there’s no reason you couldn’t code it or hire someone to do it. :)

Reply

Richard W. Matthews (2 comments.) on December 8, 2009 at 2:09 am.

Thanks Donncha,

I will actually be hiring a full-time worpress developer in a few months – so I may just have to add this to his list of projects. :P

As for having the source code… I may have it… doesn’t mean I understand a bit of it. That’s why god blessed us with genius’ like yourself and hopefully any developer I end up hiring. :D

Reply

Donncha (1707 comments.) on December 8, 2009 at 9:25 am.

Yeah, sorry for the short reply. I replied early in the morning when I was *too* tired. The biggest problem with the path AFAIR is swapping it in and out when redirecting from the domain mapped domain.

Reply

Greg Fielding (1 comments.) on December 11, 2009 at 9:07 pm.

Donncha,

I’m having some trouble getting the plugin to work correctly…I’m running WPMU with Buddypress.

When I to go the dashboard of a subdomain and click on Tools-Domain Mapping, it redirects me to the primary domain’s dashboard.

If, from the primary dashboard, I click on Tools-Domain Mapping, it takes me to the domain mapping screen to add a new domain.

Shouldn’t the subdomains be directed to that same page but for their site?

Am I missing something?

Reply

Deadpan110 (4 comments.) on December 23, 2009 at 1:56 am.

Hi Donncha,

Many thanks for this, I will be testing it out to its fullest over the next few days on our dev server ( We also use the MU Multi-Site plugin – so will be keeping a watch out for any conflicts ).

One thing I can see without testing the plugin, is a lack of do_action hooks within the code… maybe I can help with this.

Basically, our own hosting makes use of an API on our datacenter where we can use simple xml calls to add/remove domain mappings to the apache configs plus a host of other unrelated things which means that when someone successfully adds/deletes a domain mapping in the wp-admin pages, we just hook in and tell apache about the changes.

Once again – thanks!

Reply

Donncha (1707 comments.) on December 23, 2009 at 10:04 am.

Good idea about actions. Want to email me details or ideas where they should go? donncha AT ocaoimh.ie will reach me!

Reply

Deadpan110 (4 comments.) on December 24, 2009 at 7:17 am.

So that anyone reading can follow:
I have got around to testing the MU Domain Mapping Plugin (0.5) on my local dev server along side the Site Manager Plugin (0.0.9) on the current WPMU (2.8.6) and all seems to be working nicely together.

1st site: domain.tld
2nd site: another.tld
blog created: blog.another.tld
domain mapping: blog.another.tld = mydomain.tld

So far I can confirm it is working great – but not on our live system – so I suspect something else is causing redirect loops.
I will continue my testing after the holidays and let people know of my findings… also, I will be making a few minor modifications to include a few hooks and submitting them to Donncha ASAP…
I send everyone a good xmas/holiday/seasonal (delete as applicable) greeting and may the next year be a good one for everyone :)

Reply

CGeorges (1 comments.) on January 9, 2010 at 1:22 pm.

It would be nice if it had a functionality to add a domain only if the domain responds to the server ip else say that ip is not redirected and not make the modification.
Thanks, great plugin.

Reply

Deadpan110 (4 comments.) on January 13, 2010 at 11:10 am.

@CGeorges I have sent Donncha a modified version that contains plenty of hooks that you can use to add that functionality (also with a small example/readme file).

Reply

charlie (11 comments.) on January 17, 2010 at 11:18 am.

Hello!

I have two questions:

This plugin works fine with WPMU 2.9.1?

It’s possible to use mapped domain with www prefix?

Reply

Donncha (1707 comments.) on January 17, 2010 at 11:53 am.

It should work fine with 2.9.1, but no, it won’t work with www as MU strips that prefix. That will probably change in WordPress 3.0

Reply

charlie (11 comments.) on January 17, 2010 at 11:41 am.

hmm, i found a small bug:

If added domain with only english letters, and after I can’t add domain with hungarian alphabetical.
So:
I added this domain: janos.csardi.eu
And i can’t add this domain: jános.csárdi.eu, because Domain Mapping says this is an exist domain.

Reply

Donncha (1707 comments.) on January 17, 2010 at 11:51 am.

Charlie – I’d love if you could dive into the code and get that working. I never use non-English characters so it never came up in testing.

Reply

Scott on January 18, 2010 at 7:39 pm.

We had problems at first but after commenting out the define COOKIE_DOMAIN
#define(‘COOKIE_DOMAIN’, ‘.yourdomain.com’);

it worked fine.

Reply

Scott on January 18, 2010 at 7:39 pm.

to clarify that would be in the wp-config.php

Reply

Donncha (1707 comments.) on January 19, 2010 at 11:33 am.

Thanks Scott. The plugin should check for that. Just going to add it to sunrise.php

Reply

Scott (3 comments.) on January 23, 2010 at 12:10 am.

Just noticed another bug in this one and in DEV. When in the widget area of a non-mapped site the Widgets will not save.

Reply

Scott (3 comments.) on January 23, 2010 at 12:18 am.

Should have added works with define(‘FORCE_SSL_ADMIN’, true); commented out.

-scott

Reply

Donncha (1707 comments.) on January 25, 2010 at 9:54 am.

Did you debug where the POST to save the widget data was going to? What URL? On a non mapped blog the plugin shouldn’t do anything.

Reply

Scott (3 comments.) on January 25, 2010 at 6:52 pm.

I think the problem is with the
/wp-admin/admin-ajax.php which is going to http not https when the following is set define(‘FORCE_SSL_ADMIN’, true);
turning it false works fine.

Reply

Carlos on January 27, 2010 at 8:29 pm.

Donncha — great plugin and thank you so much for all the work you do

I am having a pretty serious issue (for my site) with .5, however. It appears that it breaks any functions related to detecting if a user is logged in (on the domain mapped site).

E.G., on a domain mapped site I use the template tag which should display “Login” if the user isnt logged in, or “Logout” if they are. Regardless of how many times I log in, it never detects that the user is logged in for the domain mapped site — only the “original” blog (I am using the feature you added in bullet number 3).

That feature is awesome, by the way, because it allows us to purchase ONE *.blog.com SSL certificate, and all of our users can manage their content that way, but on the domain mapped site, it doesnt seem to be dececting credentials.

Reply

Jorge on February 3, 2010 at 11:26 am.

I commented before that the plugin only works if you select permalinks that use urls like ?page=number.

However, the uploaded files like images dont work cause they use permalinks with urls like /files/2009/…../

Any idea on how to solve this? I’m stuck :-(

Reply

Donncha (1707 comments.) on February 4, 2010 at 11:41 am.

You really should be using custom permalinks when using MU due to the way it works. That’s the only way to solve this.

Reply

Jorge on February 4, 2010 at 11:49 am.

Thanks for your answer.

Is it possible to configure custom permalinks for uploaded files? How? I haven’t found any option

Reply

Donncha (1707 comments.) on February 4, 2010 at 12:02 pm.

It’s possible but you’d have to start digging into code I think.

Reply

Jorge on February 4, 2010 at 12:05 pm.

I’m confused. How is this plugin working for anybody then? I must have been misunderstanding something I guess.

iain wright (1 comments.) on February 12, 2010 at 5:17 pm.

Your domain-mapping-plugin version .51 is working for me.

It was very easy to install following your directions on the plugin page.

The enviornment:
- Ubunuty hardy 8.04 hosted @ rackspace cloud servers
- Apache 2.2 and PHP5 using a Vhost configuration
- WPMU version 2.9.1 mapping blogs to subdomains (example.domain.com)

URLS:
- http://www.deskhead.com correctly maps to deskhead.diangysys.com
- diangysys.com is the main WPMU install

Donncha, is it possible for the domain http://www.deskhead.com to not change to deskhead.com in the browser address bar? I think perhaps its my DNS records changing things around? Or is this by design & necessary?

Thanks for the great plugin! Cheers –

Iain Wright

Reply

David on February 24, 2010 at 5:07 pm.

Donncha, i think i may be having a similar issue as Jorge. Whenever I preview a post on a mapped domain it cannot find my post. I am using custom permalinks for all of my posts, but the preview URL is still ‘?p=419′. Any idea how to get around this?

Reply

Dave Abrahams (2 comments.) on March 1, 2010 at 5:19 am.

I’m having trouble getting the CNAME method to work; I end up at my server’s default “It Works!” page. I may be misunderstanding something in the readme, though. I’m not quite sure how to read these two statements:

If your user is mapping a hostname of a domain (sometimes called a “subdomain”) like http://www.example.com or blog.example.com it’s sufficient to create a CNAME record pointing at their blog url (NOT IP address).

and

Site admins can now choose to either allow users to setup DNS ANAME records by supplying an IP (or list of IP addresses) or set a CNAME but not both (entering a CNAME for the end user voids the use of IP’s)

so… does this mean the CNAME option can’t be used to map a top-level domain?

Thanks

Reply

Donncha (1707 comments.) on March 1, 2010 at 1:18 pm.

You can use it, it’s probably a misconfiguration on your server if you’re getting the “It Works!” page. The virtual host for your MU site isn’t the first one perhaps.

Reply

Dave Abrahams (2 comments.) on March 1, 2010 at 4:01 pm.

Heh, yeah; it turns out I was just expecting too much magic. Wanting to host several non-WPMU services => no fully-general wildcard vhost => I have to set up vhost matching strings for each such mapped domain. At least, I set up my lighttpd WPMU config to load last with a “.*” host match regexp and it took over all the domains I was serving, including those not intended to be WP.

Reply

R McKenzie on March 10, 2010 at 4:21 pm.

Donncha,
Thank you for the great plugin. At present, I’m running WPMU 2.9.2 with Domain Mapping .51 (testing with Firefox 3.6) — and I’m having an issue with the wp-admin login.

After searching/reading for 2 hours, I’ve not found an answer.

I noticed two people above (in your comments here) have had this same question, but it has not been answered. This was also an issue in the WPMU forums awhile back, but it appears to have gone away without much explanation as to how.

First, the issue.

On “mapped domains”, the wp-admin page redirects to the “dm_gotoadmin” page, which then returns to the default home page for that mapped domain (it does not go to the dashboard as one would hope). For example:

http://MySite.com/?dm_gotoadmin=1&back=%2Fwp-admin%2F

This happens if I enter http://MySite.com/wp-admin/ ..or.. if I use the “backend” from the administration dashboard of the main site.

I’ve cleared all cookies, verified all installation parameters (including wp-config.php notes) according to your instructions.

There are no php or httpd errors (I do have logging enabled). Everything else with domain mapping works perfect.

The only strange thing.. I notice there is a table in the database “wp_domain_mapping_Logins” and it is *empty*.

Should this have data? If so, how would I go about creating the data (either through the dashboard, or if you explain what I should enter for ‘t’ as the ‘user_id’ and ‘blog_id’ are self explanatory ;-)

Thank you in advance!

Reply

telecal on March 15, 2010 at 8:32 am.

Oh… I have the exact same problem as @R McKenzie up here… any ideas?

Reply

PAtrick Leisegang (1 comments.) on March 15, 2010 at 11:50 am.

I have a blog that started to give me a url of “http://mydomain.com/?dm_gotoadmin=1&back=%2Fwp-admin%2F”when I try to login to wp-admin

If i downgrade to v 0.43 it works just fine. Ifi use the 0.51 it doesnt work.

I get this on several domains

Reply

R McKenzie on March 16, 2010 at 2:01 pm.

That’s 5 people who have the same issue, and many more if you check the forums.

Reply

Donncha (1707 comments.) on March 16, 2010 at 2:05 pm.

@R McKenzie: I will get to this bug when I have time but I’m surprised nobody has dived into the code of the plugin and attempted to debug it for themselves.

Using error_log() and wp_mail() to log events is fairly easy and the first thing I’d do is open up domain_mapping.php and look for the “gotoadmin” string and trace the code backwards.

Go on, scratch the itch and help!

Reply

R McKenzie on March 16, 2010 at 2:45 pm.

@Donncha,
Thank you for the reply. Just the fact that you aren’t aware of the problem is enough for me to dig into the code. I’ve never coded PHP a day in my life, but I’m quite familiar with ASP and I’m sure I could make sense of it, if its not something you have time to do.

I’m just stuck with one problem — my install no longer has the error. Unable to fix the problem after hours of trying, I simply removed everything, installed WP 3.0 (beta, using Multi-Site Network) and re-installed everything from scratch. 0.51 is working fine in that instance, so I’ll have to create a new VM with 2.9.2 and 0.51 to begin testing.

One quick question, to get started. You mention — “Using error_log() and wp_mail() to log events is fairly easy” — is this something that is provided by WP, and if so, is there a developer’s guide to WP somewhere, where all of these sorts of details are provided?

If you’re referring to the wp_config file adjustment:

@ini_set('log_errors','On');
@ini_set('display_errors','Off');
@ini_set('error_log','/path/to/php_error.log');

I had placed this in my code originally, but wasn’t getting any errors (which I think I mentioned above in my post).

Reply

Donncha (1707 comments.) on March 16, 2010 at 4:42 pm.

@R McKenzie: It’s one of those bugs that strikes sometimes, and it’s the hardest of all to fix. :(

You’ll need to do more to debug it though, adding error_log() statements to the domain_mapping.php file to track where the plugin goes and what it does. It’s laborious unfortunately.

Reply

R McKenzie on March 16, 2010 at 5:19 pm.

@Donncha,
Thank you for the reply. Coming from you, as both the author and very experienced WP developer, perhaps this isn’t the best “first project” for me to delve into WP/PHP; particularly in consideration for not having an install where I can replicate this at present.

I was hoping this functionality would be intrinsic in the WP v3.0 “Multi-Site Network” feature; however, it doesn’t seem to be the case. I’m not sure why not, it seems to be a *very* fundamental component of MU/MS.

Reply

Donncha (1707 comments.) on March 16, 2010 at 5:34 pm.

So if you’re having problems with gotoadmin not redirecting it’s more than likely because you’re not logged in.

I can’t replicate the problem on my test server but start debugging in the redirect_to_admin() function in domain_mapping.php, and look for “gotoadmin” and debug the functions that use that.

Reply

R McKenzie on March 16, 2010 at 5:47 pm.

In that case, my guess is that there is an issue with reading the cookie on the user’s system, or in matching them to whatever you’re querying based on the cookie. Since in all cases, when I had the issue, I was logged-in / had logged-in, using valid credentials.

Reply

Donncha (1707 comments.) on March 16, 2010 at 5:59 pm.

@R McKenzie: Yeah, you’re supposed to be logged in when you get to the gotoadmin url. That’s what makes it so hard to debug. Could be some browser settings perhaps. Did you change any security settings? Maybe cookies security settings?

Reply

R McKenzie on March 16, 2010 at 6:15 pm.

Absolutely, positively not — no changes whatsoever (and if I had, I would have figured it out in the many *hours* of testing that I had done to try and get to the bottom of this).

I was using the same browser/workstation/configuration as was working find without domain-mapping enabled. Using the same configuration as I have now with v3 beta, that works just fine.

The problem is definitely not on the client side, I can assure you (based on hours of testing parallel WP setups). You may want to read up to my longer post above, for a quick overview, as well.

Reply

Donncha (1707 comments.) on March 16, 2010 at 6:45 pm.

Oh well, just trying to exclude all possibilities.

error_log is a standard php command, and wp_mail() has the same parameters as the mail() commands. Use Google to find the php manual entries for them.

Reply

Donncha (1707 comments.) on March 16, 2010 at 7:06 pm.

@R McKenzie: Do you remember if the “dm_gotoadmin” url was on the mapped domain or the original MU blog? It’s supposed to be on the MU domain mapped blog.

Reply

R McKenzie on March 16, 2010 at 7:12 pm.

Donncha, the problem existed only on the “mapped” domains (not the original site, which was accessible without a mapped domain). Is this the type of answer you were looking for, or did I misunderstand?

Reply

Donncha (1707 comments.) on March 16, 2010 at 7:17 pm.

@R McKenzie: No, that’s it. I still can’t replicate the problem myself. It’s bizarre.

On your new install do you have the “Redirect administration pages to original blog’s domain” option checked on the domain mapping site admin page?

The gotoadmin url is generated when that’s unchecked.

Reply

R McKenzie on March 16, 2010 at 8:11 pm.

Hi Donncha,
Under “Super Admin > Domain Mapping” I have two options.

CHECKED > Permanent redirect. (better for your blogger’s pagerank)
UN-CHECKED > Redirect administration pages to original blog’s domain

If I remember correctly, I tested both options under .51, without luck.

If we could get one of the above users to respond (or you could go into the WPMU forums), we could get someone who has the problem currently, and try running with a simple debug output rather than redirect, perhaps that would save you some time?

I’ll look for a backup as well, and try loading that onto a VM.

Reply

Tyler (1 comments.) on March 26, 2010 at 12:56 am.

I am unable to login to my mapped domain either. It fails silently. I get no warning, but a reload of the admin page.

Is there any headway on this issue?

Reply

Nick on March 27, 2010 at 4:38 pm.

I’m having this same problem that R McKenzie and Donncha have been discussing. I actually had posted over in the plugin forum prior to reading this exchange.

Fixing it is beyond my skill set unfortunately, but I’d be happy to use what I’m running to test potential fixes.

Reply

Will Castillo on April 2, 2010 at 10:48 pm.

Hello,

I just wanted to add that I had the very same problem…

And checking the infamous “Redirect administration pages to original blog’s domain” option did the trick!

Now I’m a happy WPMU/Domain Mapping user :)

Donncha et all, thanks a lot!

All best,
Will

Reply

Thom (2 comments.) on April 5, 2010 at 3:59 am.

Hi Donncha,

Thanks for this wonderful plugin. Even as a newbie I have been able to get it up and running for ten sites and they all depend on it to have their domains on the web.

But my sites’ editors also need another plugin, “TinyMCE Advanced” in order to add tables in WYSIWYG without using HTML. It does not fully work unless we disable the MU Domain Mapping plugin v 0.5.1 . We are using TinyMCE Advanced plugin v 3.2.7 in both Firefox and Safari.

In TinyMCE Advanced, the bug is when you click on a table icon or other icon that brings up a popup. Then the popup is blank so you can’t use it to make tables for example. Deactivate the WordPress MU Domain Plugin and the issue goes away.

If I replace TinyMCE Advanced with MCE Table Buttons I have the same behavior.

Do you have any idea why Domain Mapping .5.1 might conflict with the functionality of these two MCE Plugins, and what we might do.

Thanks for any help or ideas!
Thom

Reply

Otto (15 comments.) on April 5, 2010 at 10:58 pm.

Is there any way to disable the remote login? Having it redirect me to a different domain for login is breaking my alternate authentication methods (Facebook and Twitter). Both of these methods rely on redirecting to somewhere else to authenticate, then using a cross-domain receiver to set cookies which then authenticate me to the site. If the login is on the wrong domain, then the cookies can’t be set by the returning code.

Basically I’ve got ottodestruct.com and ottodestruct.com/op/. I mapped the op to ottopress.com. Now I need ottopress.com/wp-login.php to actually work and not redirect me to ottodestruct.com/op/wp-login.php instead, otherwise the Facebook and Twitter receivers can’t work.

I don’t much care if this breaks my single-login capabilities, I prefer to have my one-click login capabilities.

Using WordPress 3.0 Beta 1.

Reply

Donncha (1707 comments.) on April 6, 2010 at 12:09 pm.

Otto – I’ve been thinking about offering that as a site admin option and it was something I was going to look at this week.

Reply

Nick on April 7, 2010 at 9:51 pm.

@ Will Castillo. Thank you! That was remarkably simple.

I’m still curious to learn how the domain mapping can be accomplished for the admin so it doesn’t go to a subdomain, but for this particular project, I could care less.

Thanks again.

Reply

Jonthan on April 16, 2010 at 3:23 pm.

Hello, just wanted to know why do i have conflict in login. I’m using wordpress mu + buddypress. I really had hard time figuring whats happening I can login but when I vist the site then accessing wp-admin again it require me to login again. Please me help. Thanks! Btw great plugin!

Reply

Tim on April 27, 2010 at 7:37 am.

@Thom,

My guess is that the TinyMCE Advanced plugin uses WP_PLUGIN_URL and that is not pointing to the same domain as you have in the address bar of your browser when creating/editing a post. You’ll then get a cross-domain JavaScript error which is probably why that plugin does not work when the domain mapping plugin is also installed.

@Donncha,

Have you seen behaviour like this before? Should WP_PLUGIN_URL get updated to reflect the mapped domain?

Reply

Donncha (1707 comments.) on April 27, 2010 at 10:20 am.

Tim – I’m not sure if WP_PLUGIN_URL can be modified but I’ll look into it. Thanks for the tip!

Reply

Thom (2 comments.) on April 27, 2010 at 11:40 pm.

Thanks Tim. I went to FolioVision WYSIWYG and the problem went away.
Best, Thom

Reply

Scott on April 30, 2010 at 7:18 pm.

Hi Doncha,
Does Domain Mapping work with Load Balancing ?

-scott

Reply

Donncha (1707 comments.) on April 30, 2010 at 7:27 pm.

Yes it does.

Reply

Myk on May 2, 2010 at 5:56 am.

Having the same problem Jak had “I replaced the old sunrise.php and domain_mapping.php – now all that shows up is a blank page” This is a new install. If I delete domain_mapping.php the admin site seems to work fine, but when I try to log into any blog other than my primary when I put in admin and my password, it just keeps coming back to the login in screen with no errors. I’m pretty new and clueless at this, so thanks for any help.

Reply

Jasmo (1 comments.) on May 11, 2010 at 1:30 pm.

You can modify tinymce-advanced a little bit. You should use different constant for pluging path than WP_PLUGIN_URL.

You could do something like that in the start of the file:
$plugpath = WP_PLUGIN_URL . ‘/tinymce-advanced/mce/’;
if(function_exists(“domain_mapping_post_content”))
$plugpath = domain_mapping_post_content($plugpath);

define(“REAL_PLUGPATH”, $plugpath);

then search and replace.

Reply

Stormin (1 comments.) on May 17, 2010 at 5:18 am.

Had the same issue and spent the day nutting this out. Tried the above Jazmo detailed but couldn’t get it to work so looked a little deeper into it.

There’s an even simpler solution that I got to work and its to replace line 233 of tinymce-advanced.php

$plugpath = WP_PLUGIN_URL . ‘/tinymce-advanced/mce/’;

with

$plugpath = $blog_url . ‘/wp-content/plugins/tinymce-advanced/mce/’;

I can now add tables/images without getting blank popup windows.

Works only with 3.2.7

Reply

Peter (1 comments.) on May 20, 2010 at 9:54 am.

Hi! I’ve just installed the domain mapping plugin – and it works great! Thanks!

The only issue I have is with user registrations. Scenario:

1. my site is at maindomain.net
2. I create a subdomain blog and map it to mappeddomain.net
3. someone visits mappeddomain.net and try to register (as a subscriber), by using the link http://mappeddomain.net/wp-login.php?action=register from the “meta widget”

What happens here is that the user first is redirected to mappeddomain.net/signup.php, and then immediately to maindomain.net/signup.php, which is a completely diffferent blog – different look, and of course, different domain name, which would be very confusing to users.

Additionally, in the mail you get when you register, the link supplied is to maindomain.net… And the user is not even added to the blog at mappeddomain.net, so when he tries to log in, he gets a page telling him “You don’t have permission to view this site. Please contact the system administrator.”

Any thoughts on this?

Reply

Onno on June 29, 2010 at 12:04 pm.

I have exactly the same issue, where the visitors of the subdomain are not even supposed to know that they are on a multiblog environment.

Is there any way to break that redirect to http://mappeddomain.net/wp-login.php?action=register?

Reply

Donncha (1707 comments.) on June 29, 2010 at 12:38 pm.

That’s just how WordPress now works unfortunately. All signups have to go through the main signup page.

Reply

Onno on June 29, 2010 at 1:38 pm.

Cheers, we’ll think of a workaroud then.

Thanks,
Onno

Reply

Peter (4 comments.) on June 29, 2010 at 1:40 pm.

I actually managed to fix this with a simple plugin:

WPMU Blog Registrations

You’ll find info about it here:

http://premium.wpmudev.org/forums/topic/sharing-wpmu-blog-registrations-plugin

I’m afraid you might have to pay up for it now.. I believe it was free when I downloaded it, but not too sure. Couldn’t find a download link now..

Reply

Peter (4 comments.) on June 29, 2010 at 1:49 pm.

ahh.. found it.. here:

http://wpmudev.org/project/wpmu-blog-registrations/installation/

Reply

Paul Maunders (1 comments.) on June 18, 2010 at 10:56 am.

Does anyone know if the www. prefix is now preserved in domains with the domain mapping plugin running on WP 3.0?

Reply

Donncha (1707 comments.) on June 29, 2010 at 12:38 pm.

Yeah, www should work now.

Reply

Liron on June 29, 2010 at 2:46 pm.

I have some plugins that use the WP_CONTENT_URL constant to output css or js locations.
This constant is defined in wp-settings.php prior to loading the plugins and is initialized with the siteurl option value.
The output from these plugins is the url of my subdomains instead of the mapped TLD.
For example: http://subdomain.mydomain.com/wp-content/plugins/someplugin/thecss.css instead of
http://mymappeddomain.com/wp-content/plugins/someplugin/thecss.css
Is there a fix or a workaround? I prefer if all absolute urls on the website will include the domain the surfer is really visiting

Reply

Deadpan110 (4 comments.) on August 29, 2010 at 11:20 am.

Hi again Donncha,

I have been coding a new multisite plugin (mu-plugins) extension to my own setup and I have some compatibility issues with the current version of the Domain Mapping plugin.

It was fantastic that you added my CNAME and hook additions earlier this year and was wondering if you could add another tiny modification?

I suppose my additions _should_ be considered undocumented due to their nature, but I need to disable:
define( 'COOKIE_DOMAIN', $_SERVER[ 'HTTP_HOST' ] );
Within sunrise.php.

Basically it would involve defining a force override in wp-config.php.

Again, this should not be used by most people but my plugin requires it (and it all works with the modifications – hence a force override).

For anyone curious about what my mu-plugin does:

Scenario – You have multiple networks (so a user can create theirblog.site1.com, theirblog.site2.com etc) and you have a SSL certificate for your main site.
You would like your users to login using the SSL certificate you managed to get for your main site (SSL certificates are usually cheaper for single domains and StartCom LTD provides these basic certificates for free for one domain and a subdomain which are valid on most browsers).
Your users can setup their own domain mapping but still login over HTTPS on your main site.
If a user has multiple blogs and is already logged in on the main site, regardless of domain mapping or whatever network domain the user has, then a simple click of ‘login’ or visiting wp-admin will instantly validate you (with strict checking) and instantly log you in without supplying credentials.

Donncha – I cannot remember how I last submitted code but the changes are only a few lines and do not alter any current workings (unless the force override is set), can you please point me in the right direction yet again?

Many thanks!

Reply

Rolf on October 29, 2010 at 8:32 am.

HELP! Where can I download the old version? The old one worked like a charme, but the new one doesn’t work!!! (“Please edit your /www/htdocs/w00d0936/jesusde/wordpress/wp-config.php and move the line define( ‘SUNRISE’, ‘on’ ); above the last require_once() in that file.” > But it IS above it!)

And these are live blogs! What a shit! :evil:

Reply

Donncha (1707 comments.) on October 29, 2010 at 10:08 am.

Did you update sunrise.php?

Reply

Rolf on October 29, 2010 at 10:19 am.

No I didn’t in the first place, then i tried that and it worked *puh*… But that should be stated somewhere big and fat!

Thank you for the tip anyway! :cool:

Reply

Donncha (1707 comments.) on October 29, 2010 at 10:22 am.

It’s in the installation instructions, but I’ll add a note to the main page as a reminder to users. Glad your site is ok again!

Reply

Rolf on October 29, 2010 at 10:25 am.

Good idea! You could add this to the aboe error message, too – that would have had helped me most, i think. Thank you :-)

Liron on November 3, 2010 at 12:37 pm.

Is it possible to use a subdomain for my mapped TLD? Say that blog1.example.com is mapped to http://www.myexample.com and I’d like images.myexample.com to also be usable. Is that possible at all using the plugin?
If it’s possible, what’s the right procedure to accomplish this behaviour?

Reply

Donncha (1707 comments.) on November 3, 2010 at 1:42 pm.

Not really. You could map images… to your blog but then you have to deal with potential duplicate content issues.

You could just rewrite all your image urls to the new url and as long as there was a wildcard dns pointing at the right Apache VHOST it’ll serve the right file, maybe.

Reply

Liron on November 4, 2010 at 2:21 pm.

Thank you for the quick reply.
My current problem is that if I add a subdomain on cPanel it’ll let wpmu handle the request. This is what I want because wordpress does all the /files/… to wp-content/blogs/… translation but wpmu won’t find the blog with the images prefix. I could just change the upload dir in settings but I want multiple images subdomains so that won’t work either.
Do you have any idea how I can solve this problem?
After this is solved I think that all I have to do is rewrite the urls in .htaccess and add a filter to translate existing images’ url to the new subdomains.

Reply

Dan Smart (1 comments.) on March 16, 2011 at 2:31 pm.

Hi Donncha,

Was there any advice that was appropriate to the issue David mentioned, where on selecting Preview Post from within the Edit Post screen, it returns a 404 error.

I actually see this on some browsers, but not others, strangely. It doesn’t happen on a non-domain mapped version of the site.

Thanks in advance,

Dan

Reply

Sven on June 4, 2011 at 8:32 am.

Still have the same problem. Preview does not work!

Reply

Bill Rousseau (1 comments.) on November 1, 2011 at 11:49 pm.

Hi All,

I help manage quite a few sites on Multi Site with Domain Mapping. And while the plugin itself is invaluable the preview bug is quite a nuisance for our clients.

Is there a plan to address this? Or have I missed the fix?

Thanks!
-b

Reply

Leave Your Comment

Your email will not be published or shared. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Holy Shmoly! is Stephen Fry proof thanks to caching by WP Super Cache