WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 down vote accepted

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


AllowOverride All

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

share|improve this answer
This one worked for me. Most of the people forget about this. – qasimzee Dec 10 '14 at 18:20
This worked for me too, only had to change it in the section of apache2.conf for the location of my server files, /var/www in my case – sponrad Nov 17 '15 at 6:04

Try flushing your mod_rewrite rules:

Dashboard -> Settings -> Permalinks

Save settings (no need to make any changes)

share|improve this answer
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 had faced the same problem.

I did the following to resolve it on an Ubuntu Server:

  1. In /etc/apache2/apache2.conf, edit AllowOverride None for /var/www/ to AllowOverride All

  2. Type in the following command to enable mod_rewrite for .htaccess

sudo a2enmod rewrite

  1. Restart your apache server:

sudo service apache2 restart

The problem solved!!!

share|improve this answer
Thank you! The "a2enmod rewrite" is what I had to do! – Yoshi9143 Feb 15 at 0:34

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

In Ubuntu 14.04 - the 000-default.conf file can be found here /etc/apache2/sites-available

Or if you run multiple wp the virtual host setting would be your config file name. e.g. domain.conf

You have to replace AllowOverride None to AllowOverride All

Hope this will work.

share|improve this answer

protected by toscho Jan 9 at 19:49

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.