Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Can anyone help?

I've been building a wordpress site in a sub directory of an umbrella 'development domain' if you will, and am ready to go live with the site.

It's a single install of wordpress.

The wordpress file location is to remain exactly as it is, and we're just repointing the DNS of the live domain to the subdirectory of the development domain.

I hope this makes sense so far.

In my general > settings section of the admin, I've set the url to be

http://s391121685.websitehome.co.uk/sb

As that is the url my development domain has allocated to it. We didn't update the DNS settings of the REAL domain prior to now as there is an existing website already up.

Bearing in mind that no wordpress files are going to be moved, can i just change the wordpress address and site address under settings to www.newlivesiteurl.com?

Any advice would be appreciated.

Thanks

UPDATE **

Ok so I've edited my config file with the details suggested below, but now when i try to log into my wordpress admin, I'm stuck in a continuous loop. It juts keeps redirecting me back to the login screen!

Any help would be greatly appreciated....

share|improve this question
add comment

3 Answers 3

This question has been asked many many times before.

Here's the Codex: http://codex.wordpress.org/Changing_The_Site_URL

The easiest thing to do is add a couple of lines to your wp-config.php

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
share|improve this answer
    
Yes I appreciate that this question has been asked before - I just wanted confirmation as in this situation it's slightly different as the location of the files aren't changing. Just the domain to access the site. But thanks for confirming on the above. I figured that was the easiest method. –  V Neal Sep 5 '12 at 8:33
    
Actually one more thing - if I'm adding the above to the site config file, should I delete the entries from the admin section? –  V Neal Sep 5 '12 at 9:57
2  
You can't - if WP sees that you've defined the constants in wp-config.php, it locks the fields in Settings. So you don't need to do anything there. –  anu Sep 5 '12 at 10:06
add comment

Be aware you'll need to update all links to media in any posts you've created (or pages etc.) you can do this manually or run a find replace on your SQL dump before putting the SQL onto your live site database.

share|improve this answer
1  
Hi - yes. Thanks. Was thinking of using the Velvet Blues Update URLs plugin for this part.. –  V Neal Sep 5 '12 at 9:58
    
Yeah, it's a good plugin. I actually have a php file on my local host to do this. I have a temp database, copy the Wordpress one to it, run the php script with a find term and a replace term, the copy the tables from the temp to live. This means I don't have someone elses plugin to rely on, but as I say that plugin is good so the choice is yours :) –  Simon Forster Sep 5 '12 at 10:00
    
Hmm - my PHP isn't that great though - still finding my way around and would hate to mess things up. Maybe in time that'll be the way forward for me. –  V Neal Sep 5 '12 at 10:02
add comment

Rather bizarrely, removing the setting in the config file and changing the site's url via the admin system seems to have done the trick. Odd.

share|improve this answer
1  
That's exactly as I'd expect it to work, but I think anu was suggesting it was a more efficient way to put a site live by editing the config file. I've actually got one config file for live and dev sites with a switch statement switching on the domain name, name.com or name.dev (on my localhost) which sets the URL and database settings etc based on the url of the site. –  Simon Forster Sep 6 '12 at 9:59
    
Well 'efficient or not - it broke my site! Luckily all fixed now - probably something I did wrong... –  V Neal Sep 7 '12 at 10:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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