URL changes to using port when accessing wp-admin

I think I figured it out.

Try this on for size and let us know if it works:

  1. Navigate to your Wordpress Admin β†’ Settings β†’ General
  2. Check your site name and site host - make sure they have HTTPS and not http prefixed. I noticed that Local rewrites the site name and host to Localhost:??? whenever there is a trust issue on the certificate. At least that is what I think.

Take care

I have run into this with a multi-site. I have the siteurl and home values correct in the DB. They are also set to https.

The issue I am seeing is that when trying to connect without the trailing slash, the page is redirected to the domain with the port and without the SSL, so http. If I add the trailing slash, then everything is ok. Everyone has been mentioning that this is an issue only with Apache, but I am only using Nginx and don’t even have Apache installed for LocalWP.

So an example:
https://my-site.local/wp-admin β†’ 302 redirects to http://my-site.local:10033/wp-admin/

This is then redirecting me to the wp-signup.php page because of the domain and port change that doesn’t match. The MS is set up to run as subdomain and Local is set to Site Domains for the router mode.

I am running LocalWP 6.4.2+6012 on macOS 12.5

2 Likes

Did you find any solution I have same issues!

Hey, if you guys still suffering from this error I found a solution for it!

so this happens only when nginx configuration is trying to add a trailing slash to the wp-admin, what you can do is:

  1. go to conf\nginx
  2. open the site.conf.hbs file
  3. add port_in_redirect off; under root β€œ{{root}}”;

And You fixed it! Mark this as a solution if that worked for you so others can find it too! :grin:

2 Likes

Thank you @oumouchaibo! :green_heart: