Question

/wp-admin & /wp-login.php doesn't work after moving website from shared hosting

Hello,

Background: I moved my existing live WordPress website from Hostgator to DigitalOcean and now, I’m expecting to see it working with my IP - http://<ip> because I have not yet pointed my domain name yet (nameserver changes) and I don’t want to transfer as well and want to continue using website with http://<ip> inside DigitalOcean.

Problem: Currently, I’m able to open my website home page with IP address, but I’m unable to access /wp-admin or /wp-login.php.

Can someone help me what I could be doing wrong here?

Thank you.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @suchakmaulik179,

What is the exact error that you see when you try to visit /wp-admin?

I think that you might have to update your WordPress site and home URL to match your Droplet’s IP address so that you don’t get redirected to your domain name.

To do that just add those 2 lines to your wp-config.php file:

define( 'WP_HOME', 'http://your_server_ip_address' );
define( 'WP_SITEURL', 'http://your_server_ip_address' );

Another thing that I could suggest is to make sure that you’ve cleared your WordPress cache in case that you are using any caching plugins.

Another way of testing your site is to use your local hosts file and point your domain name to your Droplet’s IP address. That will affect only your PC and you will be able to fully test the functionality of your website directly via your domain name rather than having to change the site and the home URLs.

The location of the file is as follows:

  • Windows PC c:/windows/system32/drivers/etc/hosts

  • Mac and Linux /etc/hosts

Just open it up in your favorite text editor (e.g. Notepad) and add that line on the bottom:

your_server_ip_address yourdomain.com www.yourdomain.com

Once you have made the change, save the file and browse to your website as normal.

You will see it served from your new Droplet and will be able to test the full functionality of your CMS.

To view the site on your existing host, just remove the line from your hosts file.

Hope that this helps! Regards, Bobby