I found a post form about a year ago (it is now closed) that posed the same question I have:
I would like to have one developer environment that uses my production database. Say that our site is at http://www.mydomain.com. Now I want to have a development site at for example http://localhost/ or http://test.mydomain.com. I would in this case want to use the database that the mydomain.com site uses.
The WP documentation has an article on this: Running a Development Copy of WordPress that says to define WP_SITEURL and WP_HOME inside of wp-config.php in the environment where the ‘home’ and ‘siteurl’ fields of the wp_options table in the database DO NOT match the location of the environment, which in my case was my localhost environment. This is to effectively overwrite the values ‘home’ and ‘siteurl’ that live in the wp_options table in the database.
After doing this, the localhost site is able to pull all of the content from the production database, however I am not able to login. When I go to the login page and attempt to sign in, I am redirected right back to the login page. Has anyone seen this issue before or have any tips on how to resolve it.
- The topic ‘Run two domains from same database content’ is closed to new replies.