I moved a website from a third party to an internal IP.
I unzipped the WP installation and imported the mysql DB and ran these queries :
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');
I can see my new index.php and even login to the admin section , but I cannot get to any of the links in the pages. I get 404 errors. The admin page lists the new domain correctly.
I might be missing a .htaccess
or a rewite rule and I am not sure of what to do.
Any suggestions will be much appreciated.
Yeah, it could be your .htaccess file. You should try updating your permalinks in the WordPress admin. Switch the permalinks to the default which does not require an .htacess file, and then switch them to the one you want to use. That usually works for me.
It is probably a Permalink issue.
Checking the Permalink options from the admin panel, and comparing them with links to see if they are correct might help.
Just open your Permalinks page under Settings, and save it again.
That should fix the 404 error in most cases.
What I normally do when moving a database (wordpress as well as others) is open the database dump with a text editor and search/replace all instances of the old file system path with the new file system path and the old url’s with the new url’s. This will ensure you don’t miss any tables or columns. If the database is too large to be opened with a text editor then I write a simple script to parse through it and do the replacements. Then after the replacements are made I do the import.
Thanks for helping. I got my solution from here ..
http://www.virtualmin.com/node/17048
Are you moving the site to a Windows Server????
If you are able to see the Home page or the Admin home page, but get a 404 error when you migrate to a Windows Server, here’s how to fix that.
The site needs some redirections for sub directories in order to resolve the request properly. The follow
htaccess
rules need to be imported from the URL rewrite module.Once you paste this in the Import Rules > Rewrite Rules section, hit apply at the upper right hand corner to create the URL rewrites. You were able to confirm that the site was now working as expected. Please let us know if you have any additional questions or concerns!