.htaccess, short for hypertext access, is a directory-level configuration file. It is read by Apache and some other web servers to set rules such as URL redirects, access control and file types for one folder. The leading dot hides the file on Unix-like systems.
History of .htaccess
Creator: NCSA HTTPd developers (format origin); the Apache project kept the format in 1995. Year: 1995.
The .htaccess file format started with the NCSA HTTPd server. NCSA stands for National Center for Supercomputing Applications. The format let shared-hosting users control access. It worked in their own directories. They did this without changing the server settings. The file holds plain-text directives, one per line. The server reads them on each request. A shared host gives many customers one server. So a customer needs a file that works only inside that customer folder.
The Apache HTTP Server project was founded in 1995. It continued NCSA HTTPd. Apache kept the format and the file name. It did this for compatibility. Wikipedia says this is why the file name stayed unchanged. Sites that used the format kept their files. The file name stayed the same from that point on. Apache documents it in its 2.4 manual.
Other web servers later added .htaccess support. Their own native formats differ. Oracle iPlanet Web Server and the Zeus Web Server are examples. Wikipedia names them. Both read the file for compatibility. Their main settings use other formats.
Changelog and latest update
The Apache project kept the format when it adopted the file in 1995. It uses a subset of the directive syntax. That syntax belongs to the main Apache configuration file, httpd.conf. Each directive is one line of plain text. Apache reads the directives on each request. The file can change the AllowOverride setting. That setting decides which directives a folder file may use.
Some directives accept regular expressions in PCRE syntax. PCRE is the Perl Compatible Regular Expressions format. Wikipedia says PCRE is used only in some mod_rewrite directives. RewriteRule and RewriteCond are examples. The format itself does not use PCRE. The Apache manual lists the related modules and directives. They are for .htaccess files. They include mod_rewrite, mod_mime and mod_authz_core.
The Apache HTTP Server 2.4 manual is the current reference for .htaccess files. The newest 2.4 release is 2.4.69. It was announced on 2026-10-01. The how-to page for .htaccess files is part of the 2.4 documentation. The how-to page is the place to check the file format for each release.
Latest update: Apache HTTP Server 2.4.69, 2026-10-01
Apache released version 2.4.69 on 2026-10-01. It came from the 2.4.x stable branch. The 2.4 manual includes the how-to guide for .htaccess files. The guide describes the per-directory files. It describes their directives. It covers the troubleshooting steps. The official release page lists the change log for 2.4.69. The date and version come from the Apache project home page.
Usage examples
A .htaccess file lives in the folder it controls. It applies to that folder and the folders below it. The host must allow the directives with AllowOverride. The examples below show a permanent redirect. They show a rewrite rule that removes an extension. They show an IP address block. They show a custom 404 page. All examples use Apache 2.4 syntax.
Redirect 301 /old-page.html \
https://example.com/new-page.htmlThe Redirect directive comes from mod_alias. It sends a visitor who requests /old-page.html to the new address. The code 301 tells search engines that the move is permanent. The old address is kept in the file. So the redirect works until the line is removed.
RewriteEngine On
RewriteRule ^old$ /new-page [R=301,L]The RewriteEngine line turns on mod_rewrite for the folder. The RewriteRule line matches the path old without an extension. It redirects that path to /new-page. The R=301 flag sends a permanent redirect. The L flag stops further rules from running.
<RequireAll>
Require all granted
Require not ip 192.0.2.44
</RequireAll>This block allows every visitor except the address 192.0.2.44. The Require directives come from mod_authz_core. The example address is from the documentation range in RFC 5737. So replace it with the address to block before use.
ErrorDocument 404 /404.htmlThe ErrorDocument directive tells Apache to serve /404.html when a file is not found. Visitors then see a page from the site. They do not see the server default. The file /404.html must exist in the site root. Otherwise Apache falls back to its built-in message.
References
These sources are outside Websnoogie and were checked on 2026-10-12.
.htaccess
Wikipedia, Wikimedia Foundation
Encyclopedia article on the .htaccess file. It covers the origin in NCSA HTTPd, the 1995 Apache adoption, the directive syntax, the PCRE use in mod_rewrite and the servers that read the format for compatibility.
Apache .htaccess files how-to
The Apache Software Foundation
Official Apache guide to .htaccess files. It explains what the files are, when they should not be used, how directives are applied, and gives examples for authentication, server side includes, rewrite rules and CGI.
Apache mod_rewrite
The Apache Software Foundation
Reference for the mod_rewrite module, which provides the RewriteEngine, RewriteRule and RewriteCond directives. It describes the flags such as R=301 and L that the rewrite example uses.
Apache mod_alias
The Apache Software Foundation
Reference for the mod_alias module, which provides the Redirect and Alias directives. It explains the status codes that can be used with Redirect, including the permanent 301 code used in the first example.
Apache mod_authz_core
The Apache Software Foundation
Reference for the access control directives in Apache 2.4, including Require, RequireAll and the ip and not forms. The IP block example uses these directives as documented on this page.
RFC 5737: IPv4 Address Blocks for Documentation
IETF, RFC Editor
Document that reserves three IPv4 address blocks for documentation. The examples in this article use 192.0.2.44 from that range, so the address works in a sample without routing to a real host.
One small file can send visitors to the right page
We do not promise a ranking, a number of visitors or any set result from an .htaccess file. What we do instead is test each rule, record it and explain what it changes. An .htaccess file is a small text file that tells the server how to handle addresses.
A rule in this file can redirect an old page to a new one, force a secure address, or block a broken path. A single typo can stop the whole site. We check each change on a test address before it goes live, so visitors never see the mistake.
HTML and PHP sites fit our $129 yearly non-CMS plan, which includes free SSL and no database. WordPress sites fit our $149 yearly CMS plan. Either way, we set the rules for your address, then test each old link and each new link before we call the work finished.
Send us a list of the pages that moved and the address each one should reach. Dial 402-813-4034 to talk it through, or use the button below to start a site.
