Apache supports. htaccess configuration

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.