0

The URL of our old WordPress MU (it is WPMU, not WordPress Multisite) installation with several blogs has changed. This URL change was updated directly in the DB in the wp_blogs and wp_site tables, and elsewhere. Now the blogs are accessible, but the permalinks of all posts across all blogs are like:

http://example.com/year/month/date/postname

Instead of the previous:

http://example.com/blogname/year/month/date/postname

The /blogname/ part is missing after the domain and so every blog's post links are broken (they don't load, obviously). When I visit the permalink structure settings page, or look at the permalink stored for each blog in wp_[blogid]_options tables, it has the standard selection of /year/month/date/postname.

Setting the specific blog name as a prefix in the custom permalink definition works for posts, but not for categories/tags. This is not how it was before (so explicitly setting the specific blog name as the prefix is not the solution).

Note: To make the URL change work, the wp-config.php file had to be changed as follows to add the new URL (without which it redirects to the old one):

//---> NewURL is the complete http and domain (can't post the link here)
define( 'WP_HOME', 'NewURL');   
define( 'WP_SITEURL','NewURL');  
define( 'NOBLOGREDIRECT', '' );

Questions:

  1. Where in the database, or configuration, is the part about using the blogname in the links (for each blog) just after the domain name stored? Is there any other location for this setting?
  2. How do I eliminate the defines for WP_HOME and WP_SITEURL from wp-config.php? I didn't need these with the previous URL.
  3. The links for some of the blogs still point to the old domain. We don't have any caching plugins installed that could interfere. How can this domain change be done comprehensively?
0

It may sound stupid but I'd go to dashboard>settings>permalinks and just hit "save changes" before digging too deep.

  • Thanks, I had already tried that a few times with different permalink structures. It's all mixed up with the blogname not being in the URL or some of them pointing to the old domain. – Ps Cjef Nov 4 '15 at 3:57
0

I think it best to start out by saying MU is a very old term, and hopefully you are using it as a synonym for Multisite, even though it isn't. But the redirect issue you describe is likely due to the wp-config having the old URL still and the blogs not showing up in the URL probably resulting from an improper htaccess.

When you build a multisite, you start by adding constants to wp-config, like:

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAN_CURRENT_SITE', 'mydomain.org');

You don't actually add these all at once, but the last one is probably causing the redirect. For the correct htaccess, you'll need to choose from the ones here: https://codex.wordpress.org/Multisite_Network_Administration

  • Thanks. Actually, it is the old WordPress MU (and not multisite). There is nothing in wp-config.php referring to the domains except for what I have pasted above. I'll update the question. – Ps Cjef Nov 4 '15 at 4:36
  • In any case, the htaccess will be relevant to getting your blog inserted into the URL. – Paul B Nov 4 '15 at 5:26
  • There are multiple blogs hosted in the WPMU instance. The .htaccess file that existed before and exists now does not have anything related to specific blogs. – Ps Cjef Nov 4 '15 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.