4

I'm trying to set up Wordpress Multisite properly and I've got all the sites up, but only the primary domain's wp-admin can be accessed. I've seen various fixes for it but they only cause bigger issues. I've tried adding the following to wp-config.php, as per the instruction of several blog posts stating that this was a fix:

define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');

However, when I add those lines, I receive the following error:

The constant “COOKIE_DOMAIN” is defined (probably in wp-config.php). Please remove or comment out that define() line.

I found a fix for that error that stated moving domain_mapping.php to wp-content/mu-plugins (or wp-content/plugins) is supposed to fix that error, but it did not.

I'm at a loss for how to proceed. I do think it has something to do with my domain mapping settings but I don't know how to fix that. I've added some of my domains (50 total) to test with, but I don't see how they're mapped to anything with the sparse configuration for each available in Wordpress.

Any help is appreciated.

1
  • Sudden thought: where are your custom 'define' statements in wp-config.php? Maybe they need to be higher up in the file, so they are loaded before they get defined elsewhere. (Just a thought; and this is a very old question that I found whist bored...) Commented Feb 28, 2018 at 2:44

1 Answer 1

0

To expand on my answer in the comments.

"DEFINES" are constants that can only be defined once. If you could change the value of a constant, then it wouldn't be a 'constant'.

So, the issue is that once defined, the constants that you added cannot be redefined to other values.

It is not clear from your question where you are adding those lines, but they are probably somewhere after the constants were previously defined. If you need to change their values, then look for their original location (the place where they were initially defined). If needed, take a look at an unmodified wp-config.php file (from a fresh installation) and see where those were defined.

I'm not a big fan of changing things in the wp-config.php file from their original values. There has to be a really good reason to change things in there.

(Many times you will see advice to change the URL in the wp-config.php file, rather than changing it in the wp-options table where it supposed to be changed. I never see a good reason to change the URL in the wp-config.php file if it is properly specified in the wp-options table. But, I digress.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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