Opened 9 years ago
Last modified 6 years ago
#35912 new enhancement
Allow changing network URL scheme
Reported by: | rmccue | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | has-patch 2nd-opinion https |
Focuses: | multisite | Cc: |
Description
Right now, it's not possible to convert a network from HTTP to HTTPS. The normal way to enforce HTTPS on a site is to change the URLs for the site, but with multisite, this has to be done via the Network Admin. However, the URL isn't editable at all for the main site on the network, so it's not possible to edit it.
Attached patch allows setting only the scheme for the main site. However, this does have a big question attached: should updating the scheme for the network update it across all sites? If so, should it only update from HTTP -> HTTPS, or vice versa as well?
Attachments (1)
Change History (11)
This ticket was mentioned in Slack in #core-multisite by rmccue. View the logs.
9 years ago
#3
in reply to:
↑ description
@
9 years ago
Replying to rmccue:
Attached patch allows setting only the scheme for the main site. However, this does have a big question attached: should updating the scheme for the network update it across all sites?
could the option be available to switch schema for any site (maybe in site edit?)
If so, should it only update from HTTP -> HTTPS, or vice versa as well?
definitely should offer switch between 2. Especially helpful for coming from live to dev environment where you don't have HTTPS
#5
follow-up:
↓ 7
@
9 years ago
I have a hunch we can't get away with this as easily as the first patch suggests. I'm thinking of places like site-search that use the root domain & path for relative site look-ups. Are there any other places (maybe the by_path()
functions) where this would allow outright breaking of things without warning?
#6
@
9 years ago
should updating the scheme for the network update it across all sites?
Generally, I'd say yes, but in cases of subdomain multisite when the server does not have a wildcard cert, this would cause issues.
#7
in reply to:
↑ 5
@
9 years ago
Replying to BinaryKitten:
could the option be available to switch schema for any site (maybe in site edit?)
You can already edit the URL here for any non-main site; after this patch, the scheme will be editable for all sites, rather than just non-main sites.
Replying to johnjamesjacoby:
I have a hunch we can't get away with this as easily as the first patch suggests. I'm thinking of places like site-search that use the root domain & path for relative site look-ups. Are there any other places (maybe the
by_path()
functions) where this would allow outright breaking of things without warning?
Neither get_site_by_path()
or get_network_by_path()
use the scheme; I can't think of any other lookups that would vary based on the scheme. I think it's reasonably safe to update.
#8
@
9 years ago
In general, I think we should allow the address of the main site to be changed as we do with non-main sites. There are sticky situations to think through. :)
- In
site-info.php
, scheme is already a guess because we don't track it inwp_blogs
yet use thedomain
andpath
fromwp_blogs
to populate the (now in trunk) "Site Address (URL)" field. We use the scheme attached to the site'ssiteurl
option as our best guess. - When updating the address from
site-info.php
on a non-main site, we change thesiteurl
and/or thehome
options IF the previously setdomain
andpath
matched exactly. We then overwrite whatever the scheme was with the one entered manually in the text field. - Therefore... if we allow only the scheme to be updated on the main site's
site-info.php
, we would only be able to correctly guess that the scheme should be updated forsiteurl
orhome
ifdomain
andpath
are an exact match.
We've had some brief discussions around tracking scheme in wp_blogs
more officially so that we wouldn't have to rely on home
and siteurl
. One of the concerns was essentially how those options can already be filtered, so setting the scheme separately just moves the problem around a bit.
I guess the short version IMO: If we're going to allow scheme to be updated in this field, we should just treat the main site the same as other sites in site-info.php
.
To the secondary point - I don't think we would ever have enough information here to be able to change the scheme network wide in a subdomain installation. It's possible that we could in a subdirectory installation, though how do you enforce that with home
and siteurl
set separately for all #### sites in the network?
Add scheme input field for main site