The result is 404 Not Found directly by clicking a link. Tragedy, it seems that there is a problem with Apache Rewrite, And the. htaccess file is completely ignored! After checking the Apache module, we found that the Rewrite module is enabled. It seems that the configuration in the httpd. conf file is a bit faulty. Recall that previously, configuring Rewrite in Ubuntu Server also enables the attribute "All" called "AllowOverride" to correctly enable Rewrite, this is the problem.
Enter:
# Vim/etc/httpd/conf/httpd. conf
Find your VirtualHost settings.
<Directory/>
AllowOverride All
</Directory>
The Directory/"/" in the preceding section is your www path, for example, in the "/var/www/html" path, write it as "<Directory/var/www/html>", and so on. Restart the httpd service after saving:
#/Etc/init. d/httpd restart
Go to WordPress again and click a link! Solve the problem. It seems that this "AllowOverride" is not simple! So I searched the internet and found that this is the key point to Control. htaccess. In addition to the need to enable Rewrite in Apache and correct settings. in addition to the htaccess file name, you also need to configure AllowOverride of the Directory, because the value of AllowOverride is None by default, which will be completely ignored. htaccess file.
In addition to the values 'all' and 'none', AllowOverride also has many values whose meanings are as follows:
AuthConfig
Commands related to authentication and authorization are allowed (AuthDBMGroupFile, AuthDBMUserFile, AuthGroupFile, AuthName, AuthType, AuthUserFile, Require, and so on ).
FileInfo
Commands that control document types are allowed (DefaultType, ErrorDocument, ForceType, LanguagePriority, SetHandler, SetInputFilter, SetOutputFilter, Add * and Remove * commands in mod_mime) command (Header, RequestHeader, SetEnvIf, delimiter, BrowserMatch, CookieExpires, CookieDomain, CookieStyle, delimiter, CookieName), commands in mod_rewrite (RewriteEngine, RewriteOptions, RewriteBase, callback, rewriteRule) and Action commands in mod_actions.
Indexes
Allows the use of commands that control directory indexes (AddDescription, AddIcon, AddIconByEncoding, AddIconByType, DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName, etc ).
Limit
Allows the use of commands (Allow, Deny, Order) that control access to the host ).
Options [= Option,...]
Allows you to use commands (Options and XBitHack) that control the functions of a specified directory ). You can add a comma-separated (no space) Options list after the equal sign to control the Options that can be used by the Options command.
In this case, with All and None, there are seven optional values. It seems that we have gained a lot of insights! Similar problems will occur in the future. In any Linux system, I can easily find the problem!