.HTACCESS

HTACCESS File

Apache HTTP Server Directory Configuration File
Ask a question
QUICK ANSWER

An .htaccess file is a plain-text configuration file read by the Apache web server. It controls URL redirects, password protection, custom error pages, and access rules for the directory it sits in. Open and edit it with any text editor - Notepad++, VS Code, or nano. This is a server admin or developer file; most regular users will never need to touch one.

Developer: Apache Software Foundation Category: Web Files Open standard MIME: text/plain
OPENS ON Windows macOS Linux

On this page

19k+ extensions indexed
Last reviewed Sep 4, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the HTACCESS file format?

.htaccess is an Apache web server configuration file. Unlike most files, .htaccess does not include a filename before the dot - the leading dot is part of the name itself, making it a hidden file by default on Linux and macOS. .htaccess files should not be manually edited by unauthorized or unqualified users. The file stores all configuration in plain text.

.htaccess files contain per-directory configuration settings that define server functions such as:

  • the index (default) page of a directory,
  • access restrictions for specific IP addresses,
  • custom error pages (e.g., 404 Page Not Found),
  • URL redirects and rewrites (RewriteRule/RewriteCond),
  • password-protecting directories (AuthType, AuthUserFile),
  • additional server security settings and custom HTTP response headers.

For .htaccess to take effect, AllowOverride must be set to something other than None in the parent httpd.conf - on hardened servers, .htaccess processing is often disabled entirely.

Because Apache reads .htaccess on every HTTP request to its directory, it carries a measurable performance cost. Apache's own documentation recommends placing equivalent directives in server or VirtualHost configuration blocks instead, as those are loaded only once at startup.

.htaccess is specific to Apache; Nginx does not support it and requires equivalent rules in nginx.conf. The companion file .htpasswd stores hashed credentials for HTTP Basic Authentication.

Security & safety

RISK: HIGH

.htaccess itself is a harmless text file to open in an editor. However, it represents a CRITICAL attack surface on web servers: 1. Upload attack: if a web app lets users upload files into a web-accessible directory and Apache's AllowOverride permits .htaccess, an attacker who uploads a crafted .htaccess can re-enable PHP execution in an upload directory and run webshells. Mitigation: store uploads outside the document root; set AllowOverride None for upload directories; block .htaccess creation in upload directories. 2. Information disclosure: a misconfigured server that serves .htaccess as a text file (instead of blocking access to dotfiles) exposes server configuration, directory structure, and potentially credentials references. Apache's default configuration blocks access to .htaccess files (FilesMatch ^\.ht).

Format details

in a nutshell
FULL NAMEApache HTTP Server Directory Configuration Fileaka .htaccess file, hypertext access file
DEVELOPERApache Software Foundationsince 1994 (NCSA HTTPd, predecessor to Apache; Apache inherited it from 1995)
CATEGORYWeb Files
MIME TYPEtext/plain
TYPEplain text Apache configuration directive file
STANDARDOpen · royalty-free

Programs that open HTACCESS files

Windows5 apps
Windows Notepad Built-in File > Open - set file filter to 'All files (*.*)', navigate to .htaccess and open. No syntax highlighting.
Adobe Dreamweaver Paid Open with Dreamweaver's code editor; treats it as a plain text file.
NotePad++ text editor Open-source File > Open - navigate to the .htaccess file. Enable 'Show hidden files' in Windows Explorer first, as dotfiles are hidden by default.
Apache http server Open-source Apache reads .htaccess automatically on each request to the directory; no manual open needed.
Visual Studio Code Open-source File > Open File - select .htaccess. VS Code highlights Apache directive syntax with the Apache Conf extension.
macOS3 apps
TextMate Open-source File > Open - enable showing hidden files with Cmd+Shift+. in the file dialog.
Apache http server Open-source Read automatically by Apache on each web request.
Visual Studio Code Open-source File > Open File; show hidden files with Cmd+Shift+. in the dialog.
Linux3 apps
gedit Open-source gedit .htaccess in terminal, or File > Open with 'Show Hidden Files' enabled.
Apache http server Open-source Read automatically by Apache httpd on each request.
Vi / Vim Open-source vim /path/to/.htaccess - run in terminal.

Technical details

deep spec
OriginInherited from NCSA HTTPd (1994); Apache HTTP Server has supported it since version 1.0 (1995)
FilenameDotfile - the complete filename is `.htaccess`; hidden by default on Unix and macOS
File typePlain-text per-directory Apache configuration
EncodingUTF-8 or ASCII (must match server locale)
Typical file size100 bytes - 50 KB (most files under 5 KB)
Processing frequencyRead by Apache on every HTTP request to the containing directory and all subdirectories
Prerequisite`AllowOverride` must not be `None` in the parent `httpd.conf`; otherwise `.htaccess` is silently ignored
Common directives`RewriteRule`, `RewriteCond`, `ErrorDocument`, `AuthType`, `AuthUserFile`, `Header`, `Options`, `Redirect`
Access control syntaxApache 2.4 replaced `Allow`/`Deny` with `Require`; older syntax requires `mod_access_compat`
Nginx compatibilityNot supported by Nginx; rules must be manually translated to `nginx.conf` directives
Performance noteCauses per-request disk reads; Apache recommends preferring `httpd.conf` or VirtualHost blocks for configuration
Security riskAn attacker-uploaded `.htaccess` in a writable web directory can enable server-side script execution
Released1994 (NCSA HTTPd, predecessor to Apache; Apache inherited it from 1995)
Latest versionApache HTTP Server 2.4.x directive syntax (current)
Open standardYes · royalty-free
Specificationhttpd.apache.org

HTACCESS conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with HTACCESS files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about HTACCESS files.

Frequently asked questions

Why can't I see my .htaccess file in Windows Explorer or macOS Finder?
Dotfiles (names starting with .) are hidden by default. In Windows Explorer: View > Hidden items. In macOS Finder: Cmd+Shift+. to toggle hidden file visibility.
Can I edit .htaccess with Notepad?
Yes - any text editor works. Use Notepad++, VS Code, or Vim for syntax highlighting. In Windows, set the file type filter to 'All files' in the Open dialog.
Does Nginx use .htaccess files?
No. Nginx does not support .htaccess. Directives must be translated to nginx.conf location blocks.
Is it safe to download .htaccess files from the internet?
Treat any .htaccess snippet with caution - directives can redirect your site to third-party URLs, deny access to all visitors, or expose admin areas. Review every line before applying.
Why does my .htaccess file have no effect?
Most likely cause: AllowOverride None in the parent Apache configuration (httpd.conf or VirtualHost). Ask your hosting provider to enable AllowOverride All or specific overrides.
What is the difference between .htaccess and httpd.conf?
.htaccess applies per-directory at request time (slower, no server restart needed). httpd.conf applies globally at server startup (faster, requires root access and server restart).

References

1MDN Web Docs - Apache Configuration: .htaccessdeveloper.mozilla.org
2Apache HTTP Server 2.4 - .htaccess files tutorialhttpd.apache.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.BINCD/DVD Disc Image (BIN/CUE)
3.MDMarkdown Document
4.PARTPartial Download File
5.RPMSGRestricted Permission Message
6.CRDOWNLOADChrome Partial Download File
7.NOMEDIAAndroid No-Media Marker File
8.PRDXSoftMaker Presentations Document
9.PRO6XProPresenter 6 Bundle File
10.SWFSmall Web Format (Shockwave Flash)

Related extensions

.CRDOWNLOADChrome Partial Download File
.JNLPJava Network Launch Protocol file
.WEBARCHIVESafari Web Archive
.PARTPartial Download File
.DOWNLOADPartial / Incomplete Download File
.ASPXActive Server Page Extended (ASP.NET Web Form)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z