Local Community

WP Admin and Open Site Button Redirect to Wrong URL

Issue Summary

One or two sentence summary of the issue.
LocalWP Dashboard’s WP Admin and Open Site buttons redirect me to the wrong URL after I add the wrong code in site.conf.hbs
Even after delete the sites and uninstall LocalWP, the problem still arises.

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?
    All sites

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?
    Yes

Replication

Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!
I added some codes in site.conf.hbs with the intention to make the “WP Admin” and “Open Site” buttons automatically open the https version of the domain (without me having to manually change from http to https).
The code is:
if ($http_x_forwarded_proto != “https”) {
rewrite ^(.*)$ https://DOMAIN_GOES_HERE$1 permanent;
}
I got these lines of codes from here (Redirect HTTP to HTTPS / SSL)
I forgot to change https://DOMAIN_GOES_HERE into my domain’s URL.
Now, whenever I click “WP Admin” and “Open Site” buttons, the redirect me to the wrong URL.
WP Admin button redirect me to → https://domain_goes_here/wp-admin/?localwp_auto_login=1
Open Site button redirect me to-> https://domain_goes_here/
I already tried to delete the sites and uninstall LocalWP, but the problem still stuck.

System Details

  • Which version of Local is being used?
    Local 6.4.3
  • What Operating System (OS) and OS version is being used?
    • For example: macOS Catalina or Windows 10 Professional
      Windows 11 Home
  • Attach the Local Log. See this Help Doc for instructions on how to do so:

Security Reminder

Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hello @Gedanggoreng - welcome to the Local community! :wave:

Thank you for your question, did you end up restoring the site.conf.hbs to the original contents (ie: removing that code you added)?

And to clarify - every site is not loading correctly?

Thank you,

Sam

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.