1. Turn on the rewrite module
Vim Httpd.conf#[plain] View plain copyloadmodule rewrite_module modules/mod_rewrite.so
2. Turn on allowoverride
[Plain] View plain copy# # AllowOverride controls What directives is placed in. htaccess files. # It can be ' all ', ' None ', or any combination of the keywords: # Options FileInfo authconfig Limit # allowoverride No NE modify allowoverride None for allowoverride all
About allowoverride Instructions:
The allowoverride parameter indicates whether the Apache server is looking for a. htaccess file as a configuration file, and if set to none, the server ignores the. htacess file, if set to all, Then all the instructions in the. htaccess file will be rewritten. For allowoverride, it is also possible to specify the following types of instructions that can be overridden. The rewrite rule is usually written in the. htaccess file when the URL is rewritten using the Apache rewrite module. However, to enable Apache to read the contents of the. htaccess file properly, you must configure the directory where the. htaccess is located. From security considerations, the AllowOverride property of the root directory is generally configured to disallow any override, i.e. the code is as follows: <directory/> allowoverride None </Directory> in When AllowOverride is set to None, the. htaccess file is completely ignored. When this directive is set to all, any directives with the ". htaccess" Scope are allowed to appear in the. htaccess file. For URL rewrite, at a minimum, you need to set the directory to code as follows: < directory/myblogroot/> allowoverride FileInfo </directory>
3. Allow Apache support. htaccess
[Plain] View plain copyoptions followsymlinks allowoverride None modified to [plain] view plain copyoptions followsymlinks Allo Woverride All
4. Restart the process
Systemctl Restart Httpd.service
This article is from the "take a deep Breath again" blog, make sure to keep this source http://ckl893.blog.51cto.com/8827818/1928134
CentOS Open Apache pseudo static