Open the httpd. conf file and use a text editor to find
The code is as follows: |
Copy code |
Options FollowSymLinks AllowOverride None Changed: Options FollowSymLinks AllowOverride All |
However, I did not find Options FollowSymLinks or other things in my httpd. conf file. I have
The code is as follows: |
Copy code |
Options FollowSymLinks AllowOverride All |
Manually add it to the httpd. conf file and restart the Apache server. The problem is solved.
If Apache is not supported. in the case of htaccess, if this is not the case above, it will be in httpd. search LoadModule rewrite_module modules/mod_rewrite.so in the conf file. If there is a # symbol in front of it, remove it. Save and restart Apache.
Introduction to another article
Find the httpd. conf configuration file of Apache and open it in the editor.
The code is as follows: |
Copy code |
// Find <Directory/> Options FollowSymLinks AllowOverride None </Directory> // Change <Directory/> Options FollowSymLinks AllowOverride All </Directory> // You can. |
/*
If you want to use a file name other than. htaccess, you can use the AccessFileName command to change the file name.
For example, to use. config, you can configure it in the server configuration file as follows:
*/
AccessFileName. config
There are two main reasons to avoid using the. htaccess file.
First, performance. If AllowOverride enables the. htaccess file, Apache needs to find the. htaccess file in each directory. Therefore, whether or not it is actually used, enabling. htaccess will lead to performance degradation. In addition, you must read the. htaccess file once for each request.
In addition, Apache must be located in the directory of all superiors. htaccess file to make all valid commands take effect. Therefore, if you request a page in/ctusky/ctu/sky, Apache must find the following file:
The code is as follows: |
Copy code |
/. Htaccess /Ctusky/. htaccess /Ctusky/ctu/. htaccess /Ctusky/ctu/sky/. htaccess |
A total of four additional files will be accessed. Even if none of these files exist, this is also the reason why this article will affect the server performance.