WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I developed a site locally with /%postname%/ permalink structure. I did some sample posts locally and wanted to move this entire local setup to a temporary subdomain like http://review.clientsite.com.

1.) I exported the local sql table and imported it on the real database

2.) I changed the two fields inside the wp-options table to fit the new url http://review.clientside.com

3.) I uploaded all files to the real server and got rid of the "wp-config.php" and installed wordpress on the real server.

4.) If I launch http://review.clientside.com I see the site running and everything seems to work just fine. The stylesheets, the js, everything.

However only thing that does not work are my permalinks! Every link ends in a 404 -> e.g. http://review.clientside.com/projects

I also copied the .htaccess file from my local server to the real one. I even tried dropping the entire "permalinks" field in the wp-options table and reset the permalink-structure in the permalink settings inside wp.

Any ideas on that matter?

share|improve this question

You have to change other URLs in the database, not just in the wp_options tables. Use these queries in phpmyadmin to change post links and metadata within post and page content:

UPDATE wp_posts SET guid = replace(guid, 'http://www.olddomain.com/','http://www.newdomain.com/');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.olddomain.com/', 'http://www.newdomain.com/');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/');

Reset permalinks again after those changes. And also use the full search in phpmyadmin to check if your old domain is anywhere else, such as in widget or plugin data.

share|improve this answer
DO NOT change the guids. Those are NOT permalinks and are meant to be static once created. – EAMann Aug 14 '12 at 17:20
I've used those queries for innumerable domain and localhost to domain moves and they work fine. The queries do not change the whole GUID, only the domain part of the GUID. – markratledge Aug 14 '12 at 17:24
I'm not saying they won't work, I'm saying you shouldn't be changing the GUID at all even when you're moving domains. – EAMann Aug 14 '12 at 18:51
Thank you. But it seems the problem is somewhere else on the server. I did a clean install of wordpress on the subdomain and again – no page or post i create works - always a 404. – mathiregister Aug 14 '12 at 20:32
Looks like a server config problem; talk to the host administrator. Is mod_rewrite enabled on server? There's a placeholder page at the main domain. But the subdomain review.clientside.com doesn't even resolve for me; it is on a LAN or accessable from the internet? – markratledge Aug 14 '12 at 20:49

Your Answer


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.