There have been some issues lately with the WordPress MU Domain Mapping plugin; which has been playing with my brains for multiple weeks now. First of all the “add media” plug-in didn’t work as it used to be. When pressing the “add to post” button, nothing happened! For us developers that wouldn’t be a problem but to get users to add their images with raw html code is a little bit overkill…
I’ve started searching and found out I’ve had some error in my rewriting rules which took all requests from subdomain.artistblog.me towards it’s destination subdomain; but also including the administration interface directory which in it’s turn gave errors like cutting off the last character of the post slug, not adding categories, failing the “add media” and “add to post” button, failing random uploads and more functions that depend on the real root domain set in the WordPress database.
Next to that, I’ve started to get mildly annoyed the old posts of my blog has been lost at DIGG, because DiggBar serves as transparant proxy, but without the compatibility for URL redirects! That’s partially solved now in my solution, as long as the user has referers turned on. So, I’ve finally streamlined my rewrite rules, with the following remarks for code:
- exclude wp-admin from redirecting to the new domain
- redirect the domain with as hostname source.domain.com
- exclude the referer digg.com from redirecting the domain (for compatibility with DiggBar)
- rewrite to the new virtual.domain.com with all extra parameters
RewriteCond %{REQUEST_URI} !^/wp-admin(.*)$
RewriteCond %{HTTP_HOST} ^source\.domain\.com$ [NC]
RewriteCond %{HTTP_REFERER} !digg.com [NC]
RewriteRule (.*) http://virtual.domain.com$1 [L]
Another solution to get rid of DiggBar completely is by adding the following code to your header of your template:
<script type="text/javascript">
if (top !== self) top.location.href = self.location.href;
</script>
Have Fun, Freaking Wildchild.
No related posts.
Sorry, the comment form is closed at this time.