views:

121

answers:

3

I moved a Wordpress website from one server to another and I am now getting 404 errors on everything but the home page.

I also checked that the .htaccess file is there and the database contents. They are fine. Not sure what else could be causing this.

Any ideas from the community?

+1  A: 

Assuming the URL has changed

You need to update either the database or (if you're lucky) one of the .php files in the wordpress distro - see the wordpress article on this.

I had the same issue and ended up having to edit the database. You're seeing the 404's because wordpress thinks it's still hosted at the old URL and is therefore trying to retrieve files from it.

If the URL has not changed

Perhaps permissions need updating on the folders? The folders should be set at 755 and the files 644 (reference here).

kronoz
Kronoz, thank you for the response. I've tried both suggestions from the articles and still no luck.
NTulip
+1  A: 

Assuming you have pretty permalinks enabled, are you sure that the new server has mod-rewrite enabled? You can also check to see if this is the problem by going to a pagelike yoursite.com/?p=1 where 1 is a page id.

Jorbin
Going to /?p=2 redirects to /about/. I should note that for the reading settings I have the Front Page displays set to a static page because the theme is a CMS theme.
NTulip
mod_rewrite was the trouble maker here. Thank you. A quick "a2enmod rewrite" fixed it.
NTulip
A: 

Looks like you may have solved the problem - I had a similar problem where permalinks would not work, but the default links did work. I modified the .htaccess file to what Wordpress said to do. Twice I thought I had solved the problem, but didn't.

I had moved it to my local Ubuntu Karmic Koala system for testing, and found that the solution involved editing a file in /etc/apache2/sites-enabled. On my system, it was called 000-default.

This file had statements like the .htaccess file, and in two places had AllowOverride None, which I had to change to AllowOverride All. Apparently, this file overrides any local .htaccess files.

I also had to change the location of Wordpress in the main configuration, but that was obvious.

I hope this will help someone who has tried all the normal suggestions like me, and is still having problems.

Marty Fried