Apache support. htaccess Configuration method

Source: Internet
Author: User

After opening the httpd.conf file with a text editor open, look for

The code is as follows Copy Code

Options FollowSymLinks
AllowOverride None

Switch

Options FollowSymLinks
AllowOverride All

But I didn't find anything like options followsymlinks in my httpd.conf file. I had to

The code is as follows Copy Code

Options FollowSymLinks
AllowOverride All

Manually add it to the httpd.conf file and restart the Apache server, and the problem is resolved.


If you also encounter Apache is not supported. htaccess situation, use the above situation I do not, then in the httpd.conf file search LoadModule rewrite_module modules/mod_ Rewrite.so, if there is a # symbol in front, remove it. Save, and then restart Apache.


Another article describes

Locate the Apache httpd.conf configuration file and the editor opens.

The code is as follows Copy Code

Found it
<directory/>
Options FollowSymLinks
AllowOverride None
</Directory>

Revision changed to

<directory/>
Options FollowSymLinks
AllowOverride All
</Directory>

You can do it.

/*
If you need to use a file name other than. htaccess, you can use the Accessfilename directive to change it.
For example, if you need to use. config, you can configure it in the server configuration file in the following ways:
*/
Accessfilename. config

There are two main reasons for avoiding the use of. htaccess files.

The first is performance. If the. htaccess file is enabled for allowoverride, Apache needs to find the. htaccess file in each directory, so whether or not it is actually used, enabling. Htaccess can result in degraded performance. In addition, for each request, you need to read the. htaccess file once.

Also, Apache must look up the. htaccess file in all superior directories to make all valid directives work, so if you request a page in/ctusky/ctu/sky, Apache must look for the following files:

The code is as follows Copy Code

/.htaccess
/ctusky/.htaccess
/ctusky/ctu/.htaccess
/ctusky/ctu/sky/.htaccess

There will be a total of 4 additional files to access, even if none of these files exist, which is why this article began to say that it would affect the performance of the server.

Apache support. htaccess Configuration method

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.