WordPress is giving me 404 page not found for all pages except the homepage
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 swear I did not touch. The permalink setting is on "month and name."
I've researched similar instances of this problem online and a lot of it has to do with the .htaccess
file? I tried finding, but I can't. Perhaps it got deleted somehow? Where is it supposed to be located.
Any suggestions will be helpful
and of course I can see hidden files.
Solution 1:
.htaccess is a hidden file, so you must set all files as visible in your ftp.
I suggest you return your permalink structure to default ( ?p=ID ) so you ensure that .htaccess is the problem.
After that, you could simply set "month and name" structure again, and see if it works.
PS: Have you upgraded to 3.1? I've seen some people with plugin issues in this case.
Solution 2:
Basically the .htaccess file should exists and the httpd.conf should be correct.
In my case, I changed the file /etc/apache2/apache2.conf in section:
<Directory "/var/www/html">
Line changed is:
AllowOverride None
to
AllowOverride All
And restart the web server with
systemctl restart apache2
Solution 3:
Fixing that problem is very simple if you was using permalinks other than the default
such as Day and name
, Month and name
, Numeric
, Post name
or Custom Structure
, you only need to
Login to your admin area: Settings > Permalinks
which should be : http://yoursite.com/wp-admin/options-permalink.php
Choose Default
permalink setting, then save changes
Then you can return it again to your other previous permalink choice or keep it as default
as yo wish
Note that this problem can happen when you move your site from a domain or location to another one.