Forum archive
changing IP of WordPress VM, headbang...
Hi everyone,
I just move and change the IP of one WordPress VM.
when I type http[s]://newip I'm still redirected to the old IP...
but all the web based service
newip:12322 - Adminer
:12321 - System control panel
:12320 - Web based command line terminal
and https://newip/wp-admin are working !!
I follow this guide : https://wordpress.org/support/article/changing-the-site-url/
Nothing worked !!!

The Database:

(was containing 127.0.0.1 as default)
The wp-config.php, functions.php (under the current theme), the Relocate method #, nothing worked..
any ideas ??
My first guess on a pesky redirect that keeps redirecting, is that it was initially done as a 301 (permanently moved). If that's the case, then it's likely been stored by your browser.
If you have another browser, you can test with that (or perhaps install an additional browser if you don't have one). Another option is to use curl. Curl is available for Windows and I'm sure Mac as well (it's usually pre-installed in Linux, or can be easily installed via package management).
By default, curl will not follow redirects, so instead of being redirected, you will get a message such as this:
Obviously that is a 302 redirect (temporarily moved, which is not cached by your browser). But it gives you the idea... You can also tune the switches that you use with curl to give you different info.
Even if you don't have curl locally, in this case, you could test it from the commandline of the machine itself. Obviously that won't tell you how it was redirecting before, but it will show you what it is doing now, which may assist in troubleshooting. So try these and see what happens:
If my guess is right, and it is (or at least was) a 301 being cached by your browser, you'll need to manually clear the browser cache. The easiest is to just manually clear your whole browser cache, although IIRC you can do it site-by-site, at least in Chrome. You'll need to google the specifics of your particular browser.
Having said that, there are multiple points where a redirect could be occurring. As noted above, it could be your browser; but it could also be the web server, or the application (WordPress in this case) itself. It's perhaps worth noting, that Webshell and Webmin (ports 12320 & 12321 respectively) are behind Stunnel, so it is not surprising that they don't redirect.
On the WordPress appliance, Adminer is hosted by Apache, but as it has it's own Apache configuration (it uses a separate virtual host) and (obviously) is a completely separate application to WordPress. So that rules out a global Apache (webserver) redirect, but still doesn't rule out a redirect by the WordPress virtual host, an .htaccess file (which is essentially an Apache config snippet) within the WordPress files or the WordPress software itself.
If you care to share your Apache config for WordPress (should be /etc/apache2/sites-available/wordpress.conf), I'm happy to give you my 2c on that, but I note that the default config the WordPress appliance ships with (see here) does not redirect by default. So that seems unlikely (if you added it, I'm sure you'd remember?!)
It does sound like you may have pretty much exhausted the WordPress possibilities... Although I did find this "Webmasters" stackexchange Q&A which notes that individual WordPress modules may have (or may be) causing the redirect. This AskUbuntu Q&A (Ubuntu is also based on Debian; as is TurnKey) dicusses how to enable redirect logging. There are likely lots of other resources online which might help.