0

I want to move the site I was working on on localhost to a testing server. I have copied the database over as well as all the files. I want to be able to run my site from the testing server with the following url:

http://<IP_ADDRESS>/website

After moving the files over, I changed the following in my wp-config.php:

define('DB_NAME', 'my_db_name');

define('DB_USER', 'ellen');

/** MySQL database password */
define('DB_PASSWORD', '*****');

/** MySQL hostname */
/** I tried changing this to the IP address but it gives me a connection error **/
define('DB_HOST', 'localhost');

define('DB_CHARSET', 'utf8');

define('DB_COLLATE', '');

define('FS_METHOD', 'direct');

define('WP_ALLOW_REPAIR', true);

define('FORCE_SSL_ADMIN', false);

/*Redefine the site url*/

define('WP_HOME','http://<IP_ADDRESS>/website');
define('WP_SITEURL','http://<IP_ADDRESS>/website');

In the functions.php file of the theme I was using, I added this:

update_option( 'siteurl', 'http://<IP_ADDRESS>/website' );
update_option( 'home', 'http://<IP_ADDRESS>/website' );

When I try to access my site in the browser, I get the following error:

This page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

It tries to redirect me to http://<IP_ADDRESS>/website/wp-login.php, which is the page I want to go to. I'm unable to get to wp-admin since I can't log in.

I'm not really sure how to go about debugging this. Any help is appreciated.

Thank you!

  • Do you mean < URL> and not < IP_ADDRESS>? Also, have your tried loading the site in another browser to troubleshoot any caching issues? – Innate Sep 28 '18 at 19:46
  • I have tried other browsers, and for now I am accessing the site via the IP address like so: 111.111.11.111/website , this is how we chose to set up our testing environment – ellen Sep 28 '18 at 20:13
0

I'd just make sure that the correct URL for your site is in those two rows of the wp-options table.

The two update_option commands should not be needed. And I'd use the standard WP htaccess commands found here: https://codex.wordpress.org/htaccess

If you get the development site working and want to convert it to a 'live' site, then you only need to change the two rows in the wp-options table to the new URL. You may also need to use a plugin (I use Better Search and Replace) to change all URLs in the database to the new URL.

Of course, backups of the database is important before any major changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.