Local incorrectly adds port number when logging into wp-admin of a site

Haha! :larry_heart: Gotcha, I just wanted to make sure I wasn’t missing something :smiley:

Thanks for passing along that site, it was really helpful to see an example and as a result, I think I have distilled the steps down for a reliable reproduction:

  1. Create a new site in local

  2. Trust the SSL cert for the site

  3. Open a site shell and update the url within the DB to use the secure version of the url

    wp search-replace 'http://example.local' 'https://example.local'
    
  4. Try to log into the WP-admin when the url does not have a trailing slash. So for example, using the above url, navigate to:

    http://example.local/wp-admin
    

    and not

    http://example.local/wp-admin/
    
    
    
    

Since this is such an odd issue, I recorded my QA session. Note that an Nginx site will handle the redirect correctly, but the Apache site will not:

I’ve created a bug within our internal bug tracker program, but I don’t have an ETA for when it will be fixed. As a workaround, I imagine you might be able to add an apache redirect at the site level and then restart the site.