. htaccess file (or "Distributed configuration file")

Source: Internet
Author: User
Tags password protection

The. htaccess file (or "Distributed Profile") provides a way to configure a directory change by placing a file containing one or more directives in a particular document directory to act on this directory and all its subdirectories. As a user, the commands you can use are limited. The administrator can set it through Apache's allowoverride instructions.

As an overview, the htaccess file is a configuration file in the Apache server that is responsible for the Web page configuration under the relevant directory. Through the htaccess file, you can help us: page 301 redirect, custom 404 error page, change file extension, allow/block specific user or directory access, prohibit directory list, configure default document and other functions.

Unix, Linux, or any version of the Apache Web server is supported. htaccess, but some hosting providers may not allow you to customize your own. htaccess files.

Enable. htaccess, you need to modify httpd.conf, enable allowoverride, and use allowoverride to limit the usage of specific commands. 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 as follows: Accessfilename. config.

Broadly speaking,. Htaccess can help us implement include: folder password protection, user Auto Redirect, custom error page, change your file extension, block specific IP address of the user, only allow the specific IP address of the user, prohibit directory list, and use other files as index files and other features.

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.