Consolidating several blogs into a single multisite instance – we have 2 sets of blogs – active and archived.
What’s the best way of adding /archive/
to the URLs of the archived blogs?
So, as an example:
- An active blog would be accessed via
www.domain.com/blogname
- An archived blog would be accessed via
www.domain.com/archived/blogname
I’ve taken a look at a couple of domain mapping plugins (including the WPMU Dev) one, but I don’t think they do what I need.
In order to do partition your blogs like this you’re going to need to write a custom plugin similar to the WordPress MU Domain Mapping plugin. Here’s how your plugin needs to work.
sunrise.php
file for your plugin, and properlydefine('SUNRISE',true);
in your wp-config.php file.In
sunrise.php
perform the following logic:Finally, populate the fields of your table so that it knows which blogs are “archived”. In production you’d probably want to add some array safety checks, as well as checking that if “blog_a” is archived, then visiting yourdomain.com/blog_a redirects to yourdomain.com/archived/blog_a. All of these things can be handled in the sunrise file.