I’m migrating a WordPress site and before I switch the DNS, I want to make sure everything works by temporarily using the server’s IP and cPanel username like:

http://1.2.3.4/~username

When I access

http://1.2.3.4/~/username/wp-admin

it redirects me to

http://1.2.3.4/~/username/wp-login.php?redirect_to=http://1.2.3.4/~username/wp-admin&reauth=1

which then shows a 404 Page not found.

I tried entering

http://1.2.3.4/~/username/wp-login.php?redirect_to=http://1.2.3.4/~/username/wp-admin&reauth=1`

manually but it returns the same 404. I then tried changing the redirect_to query string value into something different and what I found out is that if I enter an IP, it shows 404 while it shows the login page when it’s not in IP form.

Can someone help what might be the problem here?

The site_url and home of wp is set to http://1.2.3.4/~username

Read more here: WordPress wp-login redirect_to returns 404 when url contains IP


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: