Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have recently changed hosting of my WordPress site to VPS.net. I have moved all of my files and imported the database. Everything appeared to be fine until I clicked a link and noticed that all of my pages are bringing back a 404 except the homepage.

Site URL is http://inksquared.com

share|improve this question

4 Answers 4

Try flushing your mod_rewrite rules:

Dashboard -> Settings -> Permalinks

Save settings (no need to make any changes)

share|improve this answer
3  
No need to even save, actually. The rules are flushed just by visiting that page, and part of flushing the rules involves writing to .htaccess. –  John P Bloch Apr 13 '11 at 18:49
    
I learn something new every day... :) –  Chip Bennett Apr 13 '11 at 18:51
    
@john are you sure that just page loads write to .htaccess if it needs to? I was under the impression that only rewrite_rules in the database are flushed. –  Ashfame Apr 13 '11 at 19:00
    
wp-admin/options-permalinks.php calls flush_rewrite_rules(), a wrapper for WP_Rewrite::flush_rules(), which, if $hard is true (which it is when called on that page) and the function save_mod_rewrite_rules exists (defined in wp-admin/includes/misc.php, included in all admin pages), it calls save_mod_rewrite_rules(). See that function's definition here: core.trac.wordpress.org/browser/trunk/wp-admin/includes/… –  John P Bloch Apr 13 '11 at 20:32
    
The function that actually writes the rewrite rules to .htaccess is called insert_with_markers (used in save_mod_rewrite_rules() above), defined here: core.trac.wordpress.org/browser/trunk/wp-admin/includes/… –  John P Bloch Apr 13 '11 at 20:33

I guess you get http://yoursite but http://yoursite/anything

I had a similar problem and it got resolved when I changed

the httpd.conf from

AllowOverride None

to

AllowOverride All

As per my understanding it will make the .htaccess take effect.

share|improve this answer
1  
This one worked for me. Most of the people forget about this. –  qasimzee Dec 10 at 18:20

Do you get a web server 404 or a WordPress 404? If it's a web server 404, you most likely didn't copy the root htaccess file over from the old installation, or it doesn't have correct permissions to run.

My first troubleshooting item would be to check and see if an htaccess file exists in the root. And if so, what it contains.

share|improve this answer
    
Checked the .htaccess file. It contains the same code that appeared in the permalink section of the wordpress admin panel. I changed the permissions to writable and can see no apparent changes. –  mikeyrocks Apr 13 '11 at 19:17
2  
@mikeyrocks Hmm... another possibility is that your new server doesn't have mod_rewrite turned on. Important: are you getting a server 404 (plain white page that says "not found"), or a WordPress 404 (styled like the rest of your site)? –  MathSmath Apr 13 '11 at 20:11

The reason is most likely that the .htaccess file wasn't copied over. On Mac OS X, and in some FTP applications, this file is considered "hidden" because it starts with a .. If you go to the Settings -> Permalinks section in your admin section, you can regenerate this file, but it's probably best to find the version you had previously and use that again (especially if you use a caching plugin).

share|improve this answer

Your Answer

 
discard

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.