WordPress is giving me 404 page not found for all

2020-05-11 03:23发布

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.

标签: wordpress
22条回答
Ridiculous、
2楼-- · 2020-05-11 03:58
  • Check that the directory on .htaccess are the correct
  • Check the fields "siteurl" and "home" are the correct
查看更多
你好瞎i
3楼-- · 2020-05-11 03:59

after 2 long days, the solution was to add options +FollowSymLinks to the top of my .htaccess file.

查看更多
贼婆χ
4楼-- · 2020-05-11 04:01

If you have FTP access to your account:

First, login to your wp-admin and go to Settings > Permalinks

You should see something at the bottom that says:

"If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all."

If this is true do the following:

  1. Go into preferences for your FTP client and make sure hidden files are displayed (varies depending on your FTP client) - If you don't do this you won't be able to find your htaccess file

  2. Go to the folder that your wp-admin, wp-content, wp-includes directories are located. Check for .htaccess file. If it exists skip to step 4

  3. If it does not exist, create a new blank file in your FTP program called .htaccess

  4. Change the CHMOD for your .htaccess file to 666 (your preference on how you want to do this)

  5. Go back to your Permalinks page and edit the link structure you want. Problem should be solved!

  6. Make sure to change the chmod of the htaccess file back to 644 after you are done.

Just had the same problem and it seemed to fix it instantly! Good luck!

查看更多
Rolldiameter
5楼-- · 2020-05-11 04:01

Before trying to do any permalink or server config changes, please check you .htaccess file. This mostly is a corrupt or blank .htaccess file issue. Reset the htaccess file to the default

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
查看更多
6楼-- · 2020-05-11 04:03

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
查看更多
\"骚年 ilove
7楼-- · 2020-05-11 04:03

I just changed the permalink to 'month and day'of all the posts by ging to setting>permalink.

Now all posts are open and working fine.

Again, I renamed to all posts to its actual permalink. Its again working fine.

This method worked for me :-)

查看更多
登录 后发表回答