• Resolved sajeconsultants

    (@sajeconsultants)


    We are running a client’s website which is set up in such a way that it does not allow its URLs to run correctly without www in the front.

    It seems that when you log into WordPress Admin, the Network Admin links all have non-www links by default. Is there a way to change this permanently?

    We’ve gone and updated .htacess to force a 301 redirect to the www version of the site a such:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com [NC]
    RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]

    This corrects the Network Admin links and they work fine, but it seems doing any specific actions within do NOT work. For example, trying to add a new user to the system causes a failure. In taking a look at the source code, I noticed that the Add User form (ex: https://www.domain.com/wp-admin/network/user-new.php) uses the following code:

    <form action=”https://domain.com/wp-admin/network/user-new.php?action=add-user” id=”adduser” method=”post”>

    Where I can force WordPress to render this code so that it uses www in front of the URL for the form action?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It seems that when you log into WordPress Admin, the Network Admin links all have non-www links by default.

    Usually that only happens if you had some weird miss-match of your domains.

    Do a search on your whole DB for https://domain.com and change it.

    Thread Starter sajeconsultants

    (@sajeconsultants)

    I’ve actually tried this and found 0 instances of https://domain.com across all database tables.

    Within wp-config.php, we currently have this line:
    define('DOMAIN_CURRENT_SITE', 'domain.com');

    Should this be changed to?:
    define('DOMAIN_CURRENT_SITE', 'www.domain.com');

    Or alternatively, within the database on the wp_blogs and wp_site tables, the domain column is currently set to ‘domain.com’. Should this be changed across the board to ‘www.domain.com’?

    Thread Starter sajeconsultants

    (@sajeconsultants)

    So I was able to get this resolved. For anyone in the future who might have the same issue, this is what I did:

    1 – Update wp-config.php to use www in the DOMAIN_CURRENT_SITE:
    define('DOMAIN_CURRENT_SITE', 'www.domain.com');

    2 – On the wp_blogs table, update domain column for MAIN site to use https://www.domain.com

    After those two changes, everything in Network Admin seems to be working correctly now!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress Multisite Network Admin URL’ is closed to new replies.