Skip to content

wp-env: Support for WP_SITEURL and WP_HOME without automatically appending port number #69776

@eliot-akira

Description

@eliot-akira

What problem does this address?

I'm setting up a local dev site with HTTPS using NGINX and a self-signed certificate (mkcert).

In .wp-env.json I have defined the constants:

{
  "config": {
    "WP_SITEURL": "https://wp.local",
    "WP_HOME": "https://wp.local"
  }  
}

However wp-env automatically adds a port number to the URL. The site still works but static assets like CSS & JS are not loaded. It can be fixed by editing ~/wp-env/UNIQUE_HASH/wp-config.php.

define( 'WP_SITEURL', 'https://wp.local:3333' );
define( 'WP_HOME', 'https://wp.local:3333' );

It would be helpful if wp-env supported an option to not append a port number to the local site URL.

What is your proposed solution?

A new option to disable appending port number to the site URL. Or maybe when the site URL ends with a trailing slash, it would be kept as is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions