D3VON
D3VON

Reputation: 43

Wordpress multisite port forwarding fails when adding new sites (behind firewall)

How do I get a WordPress Multisite working behind a firewall port forwarding external port 1731 to the machine running WordPress listening on port 443?

That configuration works well for the initial installation of WordPress, but breaks in Multisite mode for the added sites (original site still works).

Here's the behavior when adding a new site using the WordPress GUI:

Dashboard/Sites/Add New: Site Address (URL) 1.2.3.4:1731/wordpress/
(here I add 'woof' in the form)
(NOTE THAT IT KNOWS THE RIGHT PORT AT THIS POINT) I click 'Add Site' button.

When I click Dashboard/Sites/All Sites, the URL of the newly added site shows erroneously as: https://1.2.3.41731/wordpress/woof (NOTE THE MISSING COLON) So I click edit and add the colon and click 'Save Changes'

The Edit page reloads with the message "Site info updated". This time the address showing is: https://1.2.3.4/wordpress/woof (NOTE THE ENTIRE PORT IS NOW MISSING)

wp-admin/includes/network.php has: if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443', ':1731' ) ) ) ) {

wp-config.php has: define('DOMAIN_CURRENT_SITE', '1.2.3.4:1731');

Upvotes: 0

Views: 547

Answers (1)

D3VON
D3VON

Reputation: 43

WordPress has the following comment about this:

Restrictions

You cannot create a network in the following cases:
"WordPress address (URL)" uses a port number other than ':80', ':443'.

Found at: https://codex.wordpress.org/Before_You_Create_A_Network

...hope this helps someone.

Upvotes: 0

Related Questions