Installed wordpress blog from development environment does not work

I've installed a wordpress blog on my development environment. The URL for this environment is dev.mysite.com and my live environment is located at mysite.com. They both share the same database. There's an SVN that works on both environments.

I've installed the wordpress blog on my development environment and everything is fine, but when I moved to the real environment it does not open.

SELECT * FROM wp_optionsLIMIT 1000

The query above shows, that the siteurl is dev.mysite.com. I can change it, but then it will stop working on the development environment (right?). Is there any way to be able to access the blog from both environments, while sharing the same database?

Answers


In short I think the answer is no. Wordpress stores the site/base URL in a few rows in that wp_options table, so it will only work properly for one URL. Is there a reason you need to point them both to the same DB?

When I'm working on Wordpress I just work on the one dev environment and then update my live site incrementally. I thought that was the reason you would have separate environments!


It is a VERY BAD IDEA to use same DB for both development and production, because you can accidently break it (always have backups!). You should have separate DBs, and the one for production should only be used by production app.

You better use some build tools to update production automatically if you need it often, or at least do it manually. Consider using Phing or another build tools.


Need Your Help

How to do different Animations on the same page but on different screen sizes?

c# windows animation visual-studio-2015 uwp

I am making a UWP app in which in which I need to different animations for different screen sizes on the same page. I want if screen width is less than 400 this animation should play, If screen wit...