I’m running into a strange issue on a production server. I’m unable to login to the admin - there are no errors, but the redirect is back to the login. There are no plugins active and I’ve cleared cookies and cache.
and the site url and the home url were both being set to http://example.com/wp/
so I tried setting the home url directly in the database to http://example.com/ but no luck.
The issue is not happening in staging or development with the same repo and database.
I’m using trellis and sage theme. So running nginx
Hi - no it’s not under https the only thing I can think of is that it was provisioned using the ip, where as the staging was provisioned using the domain in the hosts file, but that has never been an issue before and I don’t know why it would effect anything.
Is there anything I can do to log and debug the issue as it is becoming more pressing?
I’ve just deployed the live version of the site on production and this has still been an issue, but I’ve figured out why (it was my fault) but I’m not 100% sure I’ve fully cleaned up the problem.
The site is now under https btw.
I had originally provisioned the production with a redirect (wordpress_sites.yml)
env:
disable_wp_cron: true
wp_home: https://thesitename.com
wp_siteurl: https://www.thesitename.com/wp
wp_env: production
(I’d for some reason added www to the site url)
So I removed that from the setting and reprovisioned - but it still didn’t work.
So I removed the redirect and reprovisioned again and now it works - in that I can log into the admin - but the admin is at www.thesitename.com/wp
The front end of the site is at thesitename.com and if you put in www.thesitename.com it redirects correctly to thesitename.com without www
So it seems to work - apart from the admin area almost having an inverse redirect TO www.
I would have expected that by reprovisioning the settings would be correct - is there some reason the admin is still under www. even though I reprovisioned after correcting my initial error?
Unfortunately WP stores a lot of settings in the database so I’m guessing that setting is just persisted there. You’d have to manually update the DB or re-install WP. WP-CLI has some nice commands for search + replace.