404 error - Moving local wordpress page to a real server subdomain broke my permalinks?

I developed a site locally with %postname% permalink structure. I did some sample posts locally and wanted to move thi

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 .

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

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 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.

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?

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.

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

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 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/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 asked Aug 14, 2012 at 15:34 mathiregistermathiregister 1,54313 gold badges55 silver badges78 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

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/','http://www.newdomain/');

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

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

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.

My checklist for such cases is as follow:

  1. .htaccess, did I plug it in the prod website?
  2. Did I scrub the database properly?
  3. As a last resort, can I modify it in wp-config.php?

    1. -- htaccess -- One thing that is important to consider is the existance of a .htaccess file. It seems to be the most common issue.

    2. -- DB Scrub -- When migrating data local->development->staging, I personally use the following tool to "scrub" the database. Interconnect/IT (https://interconnectit/products/search-and-replace-for-wordpress-databases/) -- Not paid, just awesome for DB scrubbing.

    3. wp-config.php -- Alternatively, you can do the following in your wp-config.php file:

!defined('WP_SITEURL') && define('WP_SITEURL', 'http://review.clientside');
!defined('WP_HOME') && define('WP_HOME', "http://review.clientside");

In all cases, make sure to reset permalinks from WP admin, after you complete the setup.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745163255a4614500.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信