最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

site url - How do I change the Multisite URL?

programmeradmin3浏览0评论

The links in the navbar menu, in (My sites > Manage the network) are pointing (and keep redirecting) to incorrect URLs.

The incorrect URLs are in this pattern:

https://https//www.domain/wp-admin/network/
https://https//www.domain/wp-admin/network/sites.php
https://https//www.domain/wp-admin/network/settings.php

Even if I manually entered the correct URL without the repeated https, I am redirected to the wrong URL again.

It seems that https//www is set somewhere instead of https://www, I can't find where.

Places that I have looked and they were OK:

  • wp-config.php (DOMAIN_CURRENT_SITE)
  • .htaccess
  • site table (domain only, with www but not https or /)
  • options table (situeurl and home)
  • sitemeta table

I haven't updated any of the above-mentioned. They were OK. (So not cache issue)

I tried the Search option of my phpMyAdmin using https//www but didn't return any match.

Where else should I look?

The links in the navbar menu, in (My sites > Manage the network) are pointing (and keep redirecting) to incorrect URLs.

The incorrect URLs are in this pattern:

https://https//www.domain/wp-admin/network/
https://https//www.domain/wp-admin/network/sites.php
https://https//www.domain/wp-admin/network/settings.php

Even if I manually entered the correct URL without the repeated https, I am redirected to the wrong URL again.

It seems that https//www is set somewhere instead of https://www, I can't find where.

Places that I have looked and they were OK:

  • wp-config.php (DOMAIN_CURRENT_SITE)
  • .htaccess
  • site table (domain only, with www but not https or /)
  • options table (situeurl and home)
  • sitemeta table

I haven't updated any of the above-mentioned. They were OK. (So not cache issue)

I tried the Search option of my phpMyAdmin using https//www but didn't return any match.

Where else should I look?

Share Improve this question asked Feb 2, 2019 at 10:51 Abdulrahman HassounAbdulrahman Hassoun 2211 gold badge2 silver badges5 bronze badges
Add a comment  | 

6 Answers 6

Reset to default 12

There are 5 values need to change. From database.

wp_options: options named “siteurl” and “home”

wp_site

wp_sitemeta: the option named “siteurl”

wp_blogs: any entries in the “domains” column that have the old domain name

wp_#_options: Each sub-site will have sets of tables that correspond to the blog_id in the wp_blogs table. You need to go to the wp_#_options table, where # corresponds to the blog_id, and update the “siteurl” and “home” settings in that table.

Note: In most cases, you may/will need to update an entry in your WP-Config.php file. The code I would recommend taking a look at is the code snippet here:

define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'mysite' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

The multisite URLs are available for editing on the Network Admin, Sites page, then edit the subsites (click on a subsite's edit link, then the Settings tab). You can only do this for subsites.

The 'siteurl' and 'home' values should be the full URL of the site, including the protocol, as in https://www.example/site1 . If those values do not include the protocol (the 'https://' part), then any links of the site will include the 'double protocol' value that you are experiencing.

The main site URL cannot be edited on this screen; go into the wp-options table to fix that (in two places).

I never change the site URLs in the wp-config.php file, as suggested by other answers and comments. The proper place (IMHO) to make the site URL setting is the wp-options table (for the main site), and the procedure above for the sub-sites.

Note that the above procedure will also let you change any incorrect URLs saved by any plugins that write to the options table. I've had to change that a couple of times when I moved a site to a new domain.

You have to change at two places:

1- in Database wp_blogs table change example to www.example

2- in wp-config.php change define('DOMAIN_CURRENT_SITE', 'example'); to define('DOMAIN_CURRENT_SITE', 'www.example');

It will work automatically.

Have you checked wp_blogs? Is it OK?

Also, make sure that all the pre-defined constants in your wp-config.php file are commented out. Otherwise, they will override the database settings.

Add this code to your wp-config.php file,

define('WP_HOME','https://yoursite');
define('WP_SITEURL','https://yoursite');

If still, you face the issue then login to your phpMyAdmin and then,

  • Choose the name of the database from the left-hand sidebar and open the wp_options database table.
  • Search for the site URL and home rows, click edit to modify the URLs. You can see a box in front of option_value to fill in the URL.
  • Click on the Go button to save settings.

Also, make your URL start with https:// not http// (you mentioned above)

Simply change this in phpmyadmin in "prefix"_options table siteurl & homeurl in column option_name

发布评论

评论列表(0)

  1. 暂无评论