开发者

Wordpress home page shows a 404 error

I have a wordpress site in one domain (say domain1)

Now i created a wordpress in another domain (say domain2)

and put the theme from domain1.

An开发者_如何学God updated the DB with the Db from domain1

Now while i take new wordpress site's(ie wordpress in domain2) home page ,it shows a 404 error

Will any one please help


You can't just put the wordpress tables from one domain into the DB of another domain. There are some configuration values saved on the DB that need to be updated with the name of the new domain.

That could be the source of the 404 error. To solve this, open the SQL or CVS DB file in a text editor and search/replace the old domain name for the new one.


You have to follow certain steps to 1) move WordPress within a host, and 2) move Wordpress to a different domain.

This mostly involves changing URLs in the database either by moving Wordpress in a certain way so that the database gets updated, or updating the database after the fact. And updating permalinks in .htaccess, too.

See Moving WordPress « WordPress Codex and How to Move WordPress Blog to New Domain or Location » My Digital Life.

None of these steps will change URLs hardcoded in theme files, like header.php or the style sheet if you edited those while building a theme.

SQL queries to change URLs in the database via phpmyadmin.

UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

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

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


If the files are there, under the domain. First, try domain2.com/index.php. If it works, you must add an .htaccess file to your directory with the enrty

DirectoryIndex index.php

If it is not there, the domain points to different directory. Then it is not a wordpress related issue, only server config which can be resolved by your host company.


Trouble is, a 404 error can come from so many places. Did you just register the new domain? If so, it might just take a while for the DNS changes to propogate.

You will probably also have to change the configuration settings for the new domain's wordpress site. You can find detailed instructions on how to change it (wp-config.php) here http://codex.wordpress.org/Editing_wp-config.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜