.htaccess
File Type |
Apache HTACCESS File |
File Format |
Standard |
Usage |
Open manually; may be referenced by an application |
Popularity |
★ ★ ★ ★ ☆ Common |
Description |
An HTACCESS file is a configuration file used by Apache web servers. It provides instructions or "directives" for different directories within a website.
▶ "htaccess" is short for HTTP access. HTTP is the protocol used for transmitting webpages from a web server to a client's browser.
An .htaccess file may contain multiple directives, such as:
- Execute MOD_REWRITE instructions (to simplify URLs)
- Define the index page of a directory (i.e. "index.html" or "index.php")
- Specify the 404 (Page not found) error page
- Perform 301 or 302 page redirects
- Deny access from specific IP address or other websites
- Restrict access to certain directories and pages
HTACCESS files are always named ".htaccess". Because they do not include a filename before the dot, they may be hidden by default. HTACCESS files may be placed within any directory of a website, including the root directory. They are processed by the web server each time a webpage is accessed.
|
Open With |
Windows |
Apache Web server
Microsoft Notepad
Other text editor
|
macOS |
Apache Web Server
MacRabbit Espresso
MacroMates TextMate
|
Unix |
Apache Web server
Other text editor
|
|
Updated |
March 21, 2022 |
|