wordpress只有主页能访问,其他菜单不能访问 Custom Permalinks Return 404 Errors

来源:互联网 发布:php简单后台html5源码 编辑:程序博客网 时间:2024/06/05 18:58

转的外文。原文地址 https://theme-fusion.com/knowledgebase/custom-permalinks-return-404-errors/


If you are getting 404 error when accessing pages, please see the information below.

Symptom: I just setup my WordPress installation and my awesome new Avada theme. I went into Admin -> Settings -> Permalinks and selected something other than the default option. But now when I try and navigate to a page, it just returns a generic “404 Error – Page not found” message. What gives?

Likely causes: First, this is not a theme issue. The problem involves your core WordPress installation, or your web server configuration. That said, there a few things that can cause this to happen:

  • Apache II mod_rewrite module is not being loaded by your web server.Your WordPress .htaccess file is missing or not writeable by the web server.Apache II is configured to disallow overrides by your .htaccess file.

Solutions: There are several solutions to this issuse, please see the bulleted list below.

  • First make sure that mod_rewrite is installed and enabled on your Apache II web server, and also make sure that the webserver allows your .htaccess file to override the server directory configuration.Make sure that your WordPress .htaccess file is present in your WordPress installation. If it is not, simply create a blank file called .htaccess and upload it to your WordPress installation folder.Set permissions on your .htaccess file that allows your web server to write to the file – CHMOD 666.Go back and set your permalinks option to the “default” option and save the change. Then set it to something other than the default and save the change.If your .htaccess file is writeable by the web server, it will contain new directives that sets rewrite rules for your custom permalink option.If it is not writeable, you will see a message below your permalinks screen that contains the rule set you need to add manually into your .htaccess file, save it, and upload it back to the WordPress installation folder.Check to see if you can navigate from your front page menu links without error.If the issue persists, contact your web host support team for further assistance.


apache 开启 mod_rewite

How to configure the Apache mod_rewrite module

  1. Open the Apache configuration file located at/etc/httpd/conf/httpd.conf
  2. Change AllowOverride None to AllowOverride Allinside the DocumentRoot Directory Directive, normally<Directory "/var/www/html">
0 0
原创粉丝点击