WordPress is giving me 404 page not found for all pages except the homepage

后端 未结 22 1760
独厮守ぢ
独厮守ぢ 2021-01-29 21:35

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

22条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-29 22:32

    If the default behavior (example.com/?p=42) is working, you should:

    • Change to your preferred permalink style: Admin: Settings > Permalinks, and click Save. Sometime it fixes the issue. If it didn't:
    • Verify that the file /path/to/wordpress/.htaccess has been changed and now includes the line RewriteEngine On. If it doesn't include the line, it's a Wordpress permissions issue.
    • Verify that the 'rewrite' module is loaded: create a PHP file with

      
      

      in it, open it in the browser and search for mod_rewrite. It should be in the 'Loaded Modules' section. If it's not, enable it - Look at your apache default index.html file for details - in Ubuntu, you do it with the helper a2enmod.

    • Verify that apache server is looking at the .htaccess file. open httpd.conf - or it's Ubuntu's alternative, /etc/apache2/apache2.conf. In it, You should have something like

      
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
      
      
    • After making these changes, don't forget to restart your apache server. sudo service apache2 restart

提交回复
热议问题