Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.
【 Rewrite failed under Apache 】 Do not succeed according to the following three steps: /conf/http. CNF /conf/http. CNF /conf/http. CNF File search rewrite find #LoadModule rewrite_module modules/ mod_rewrite_so to LoadModule rewrite_module modules/mod_rewrite.so
Continue searching for ‘.htaccess ‘in this file and we find AllowOverride None as the comment corresponds
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride None
And then we’re going to change AllowOverride None to AllowOverride All and notice where it’s changed because there are multiple places in this file and AllowOverride None is only valid if the right place is found
Step 3: Restart Apache If you cannot save the http.conf file in Windows, use editPlus to open the file and click Save as a copy. AccessFileName .htaccess
Restart Apache and change the file name to htaccess
【 the 】
If it still doesn’t work, check your rewrite syntax.
Buy me a cup of coffee 🙂