2

I've cloned the production site at example.com to my own dev server, calling it example.mydomain.com. It displays OK, as long as I use port 8080 (bypassing my varnish server).

I can successfully log in to the wp-admin page at example.com, but I can't reach the page at example.mydomain.com/wp-admin - it redirects to the homepage of example.com.

Suspecting my varnish set up might be at fault, I visited example.mydomain.com:8080/wp-admin and was presented with a login form.

However, entering the credentials there logs me into and redirects me to, example.com/wp-admin/ - the production site. I've even looked at the query string that appears thus: http://example.myserver.com:8080/wp-login.php?redirect_to=http%3A%2F%2Fexample.myserver.com%3A8080%2Fwp-admin%2F&reauth=1 - which looks like it'll do the right thing, but no joy.

I've done a full text search of the codebase, looking for places where the server name might be hard coded, and found nothing obvious (except some image links in the CSS).

So I'm thinking maybe there's some config settings stored in the database. But I have no idea where to look.

1

2 Answers 2

1

Check for wp-config.php file.

Find these two lines to your wp-config.php, and make sure "example.com" is the correct location of your site.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Also on the database, check for table wp_options, check these two option_name; siteurl and home.

2
  • I have same problem with OP. My wp-config.php does not contain these two lines. Haven't checked the db yet.
    – IXN
    Jul 23, 2018 at 19:15
  • Add a new question, your problem is a bit different. Jul 23, 2018 at 19:28
0

Try this to change the url under wp_options on the database: https://www.hostinger.co.uk/tutorials/wordpress/how-to-change-wordpress-urls-in-mysql-database-using-phpmyadmin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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