All of a sudden I go to my WordPress website and all the pages give me a 404 page not found page. I\'m assuming the problem lies with the permalink structure, which I could swea
Most of the time this issue is fixed by simply visiting the Settings -> Permalink page in the WordPress admin and click Save (as several other answers already pointed out). When this page is accessed, WordPress rewrites the directives in the .htaccess
file which magically fixes the issue. The issue often happens after moving a site (the site breaks because the .htaccess
gets left behind or the settings need to be updated).
If WordPress doesn't have the right permissions to write the .htaccess
file, a notice will appear at the top of the page and further instructions at the bottom when the settings are saved. In this case you need to edit the .htaccess
file yourself or, better, to fix the permissions on that file. The file is at the root of the WordPress installation. cd
into the directory and sudo chmod 644 .htaccess
. You might also want to check if the file belongs to the right group and change that is needed with chown
. Ask your hosting provider if you don't know how to do that.
If you are on shared hosting that's probably all you can do. If you still have the issue you might want to talk to you hosting provider's support. Otherwise, make sure the use of .htaccess
files is enabled on the server, as @georgeos already suggested. Note that httpd.conf
is not always used (Ubuntu indicates it is deprecated but the official Apache docs still says it is often the main configuration file). /etc/httpd/conf/httpd.conf
and /etc/apache2/apache2.conf
seem to be the most common places for this file. Find the block for the public folder, usually
and make sure that the AllowOverride
directive is set to All
. If it is set to None
, your .htaccess
file is simply ignored by the server.