views:

123

answers:

1

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!

+2  A: 

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');
Jan Fabry
thanks for this! however this works partly tho. It works well when I load the root wp directory, but going to wp-admin, it still redirects me to the site_url's database entry.
Kasper
Bizarre, because it works for me. Make sure your browser cache is empty, redirects are sometimes cached too.
Jan Fabry
Thought so too, but that isn't the case. *scratches head*
Kasper
Ok solved! needed to add it to wp-load.php; if ( file_exists( ABSPATH . 'wp-config-local.php') ) { require_once( ABSPATH . 'wp-config-local.php' );}for some reason otherwise admin wont take itthanks a ton!
Kasper