Get wordpress to redirect_to different places, or don't redirect at all
I am trying to develop a wordpress theme together with someone else. We are basically working from the same svn repository which has the copy of the wordpress files and the database we access somewhere remotely to speed up the devving progress.
Now here comes the problem; as soon as we try to access the wp-admin it redirects us to the root url of our localhost. But for either of us, our project is hosted somewhere else on the localhost. Par example:
his: http://hislocalhost/svn/projects/project/wp/wp-admin/
mine: http://mylocalhost/project/wordpress/wp-admin/
Now i've gotten so far as to change the values for the site_url in the database, but we're using the same database so if i change my site url to: http://mylocalhost/project/wordpress/, he will get redirected to:
http://mylocalhost/project/wordpress/wp-login.php?redirect_to=http://hislocalhost/svn/projects/project/wp/wp-admin/&reauth=1
Which is greatly annoying开发者_开发问答 since that doesnt exist for him. At this stage, I wonder if it be possible to turn of the whole redirection bs?
Thanks!
You can override the address set in the database via the WP_SITEURL
and WP_HOME
config options. If you put these in a config file that does not get checked in (put it in .svnignore
), you can have different locations on both development environments.
// in wp-config.php
if (file_exists('wp-config-local.php')) {
include('wp-config-local.php');
}
// in wp-config-local.php
define('WP_SITEURL', 'http://localhost/project/wordpress');
define('WP_HOME', 'http://localhost/project/wordpress');
精彩评论