<s>
An	O
.htaccess	B-Protocol
(	O
hypertext	O
access	O
)	O
file	O
is	O
a	O
directory-level	O
configuration	B-Protocol
file	I-Protocol
supported	O
by	O
several	O
web	B-Application
servers	I-Application
,	O
used	O
for	O
configuration	O
of	O
website-access	O
issues	O
,	O
such	O
as	O
URL	O
redirection	O
,	O
URL	O
shortening	O
,	O
access	O
control	O
(	O
for	O
different	O
web	O
pages	O
and	O
files	O
)	O
,	O
and	O
more	O
.	O
</s>
<s>
The	O
'	O
dot	O
 '	O
(	O
period	O
or	O
full	O
stop	O
)	O
before	O
the	O
file	O
name	O
makes	O
it	O
a	O
hidden	B-Application
file	I-Application
in	O
Unix-based	O
environments	O
.	O
</s>
<s>
A	O
site	O
could	O
have	O
more	O
than	O
one	O
.htaccess	B-Protocol
file	O
,	O
and	O
the	O
files	O
are	O
placed	O
inside	O
the	O
web	O
tree	O
(	O
i.e.	O
</s>
<s>
inside	O
directories	B-Application
and	O
their	O
sub-directories	O
)	O
,	O
and	O
hence	O
their	O
other	O
name	O
distributed	O
configuration	B-Protocol
files	I-Protocol
.	O
</s>
<s>
.htaccess	B-Protocol
files	O
act	O
as	O
a	O
subset	O
of	O
the	O
server	B-Application
's	O
global	O
configuration	B-Protocol
file	I-Protocol
(	O
like	O
httpd.conf	B-Application
)	O
for	O
the	O
directory	B-Application
that	O
they	O
are	O
in	O
,	O
or	O
all	O
sub-directories	O
.	O
</s>
<s>
The	O
original	O
purpose	O
of	O
.htaccess	B-Protocol
—	O
reflected	O
in	O
its	O
name	O
—	O
was	O
to	O
allow	O
per-directory	O
access	O
control	O
by	O
,	O
for	O
example	O
,	O
requiring	O
a	O
password	O
to	O
access	O
World	O
Wide	O
Web	O
content	O
.	O
</s>
<s>
More	O
commonly	O
,	O
however	O
,	O
the	O
.htaccess	B-Protocol
files	O
define	O
or	O
override	O
many	O
other	O
configuration	O
settings	O
such	O
as	O
content	B-Application
type	I-Application
,	O
character	B-General_Concept
set	I-General_Concept
,	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
handlers	O
,	O
etc	O
.	O
</s>
<s>
.htaccess	B-Protocol
files	O
are	O
written	O
in	O
the	O
Apache	B-Application
Directives	O
variant	O
of	O
the	O
Perl	B-Language
Compatible	I-Language
Regular	I-Language
Expressions	I-Language
(	O
PCRE	B-Language
)	O
language	O
.	O
</s>
<s>
Learning	O
basic	O
PCRE	B-Language
itself	O
can	O
help	O
in	O
mastering	O
work	O
with	O
these	O
files	O
.	O
</s>
<s>
For	O
historical	O
reasons	O
,	O
the	O
format	O
of	O
.htaccess	B-Protocol
files	O
is	O
a	O
limited	O
subset	O
of	O
the	O
Apache	B-Application
HTTP	I-Application
server	I-Application
's	O
global	O
configuration	B-Protocol
file	I-Protocol
httpd.conf	B-Application
even	O
when	O
used	O
with	O
web	B-Application
servers	I-Application
such	O
as	O
Oracle	B-Language
iPlanet	I-Language
Web	I-Language
Server	I-Language
and	O
Zeus	B-Protocol
Web	I-Protocol
Server	I-Protocol
which	O
have	O
very	O
different	O
native	O
global	O
configuration	B-Protocol
files	I-Protocol
.	O
</s>
<s>
Authorization	O
,	O
authentication	O
A	O
.htaccess	B-Protocol
file	O
is	O
often	O
used	O
to	O
specify	O
security	O
restrictions	O
for	O
a	O
directory	B-Application
,	O
hence	O
the	O
filename	O
"	O
access	O
"	O
.	O
</s>
<s>
The	O
.htaccess	B-Protocol
file	O
is	O
often	O
accompanied	O
by	O
a	O
.htpasswd	O
file	O
which	O
stores	O
valid	O
usernames	O
and	O
their	O
passwords	O
.	O
</s>
<s>
URL	B-Protocol
rewriting	I-Protocol
Servers	O
often	O
use	O
.htaccess	B-Protocol
for	O
rewriting	O
long	O
,	O
overly	O
comprehensive	O
URLs	O
to	O
shorter	O
and	O
more	O
memorable	O
ones	O
.	O
</s>
<s>
Often	O
used	O
to	O
restrict	O
access	O
by	O
web	B-Application
crawlers	I-Application
.	O
</s>
<s>
SSI	O
Enable	O
server-side	O
includes	O
.	O
</s>
<s>
Directory	B-Application
listing	O
Control	O
how	O
the	O
server	B-Application
will	O
react	O
when	O
no	O
specific	O
web	O
page	O
is	O
specified	O
.	O
</s>
<s>
Customized	O
error	O
responses	O
Changing	O
the	O
page	O
that	O
is	O
shown	O
when	O
a	O
server-side	O
error	O
occurs	O
,	O
for	O
example	O
HTTP	B-Protocol
404	I-Protocol
Not	I-Protocol
Found	I-Protocol
or	O
,	O
to	O
indicate	O
to	O
a	O
search	O
engine	O
that	O
a	O
page	O
has	O
moved	O
,	O
HTTP	B-Protocol
301	I-Protocol
Moved	I-Protocol
Permanently	I-Protocol
.	O
</s>
<s>
MIME	B-Application
types	I-Application
Instruct	O
the	O
server	B-Application
how	O
to	O
treat	O
different	O
varying	O
file	O
types	O
.	O
</s>
<s>
Cache	O
control	O
.htaccess	B-Protocol
files	O
allow	O
a	O
server	B-Application
to	O
control	O
caching	B-Protocol
by	O
web	B-Application
browsers	I-Application
and	O
proxies	O
to	O
speed	O
up	O
websites	O
,	O
reduce	O
bandwidth	O
usage	O
,	O
server	B-Application
load	O
,	O
and	O
perceived	O
lag	O
.	O
</s>
<s>
.htaccess	B-Protocol
also	O
adds	O
the	O
cache	O
age	O
to	O
the	O
webpage	O
resources	O
so	O
that	O
on	O
revisiting	O
the	O
page	O
,	O
the	O
elements	O
are	O
reloaded	O
from	O
browser	B-Protocol
cache	I-Protocol
till	O
the	O
age	O
mentioned	O
expires	O
,	O
instead	O
of	O
requesting	O
the	O
resource	O
again	O
from	O
the	O
server	B-Application
.	O
</s>
<s>
HTTPS	B-Protocol
&	O
HSTS	B-Protocol
Implementation	O
of	O
both	O
HTTPS	B-Protocol
and	O
HSTS	B-Protocol
on	O
Apache	B-Application
servers	I-Application
is	O
largely	O
dependent	O
on	O
correct	O
URL	B-Protocol
rewriting	I-Protocol
&	O
header	O
information	O
mentioned	O
in	O
.htaccess	B-Protocol
file	O
.	O
</s>
<s>
Any	O
incorrect	O
syntax	O
in	O
the	O
file	O
while	O
deploying	O
HTTPS	B-Protocol
or	O
HSTS	B-Protocol
leads	O
to	O
a	O
failure	O
in	O
implementation	O
.	O
</s>
<s>
Immediate	O
changes	O
Because	O
.htaccess	B-Protocol
files	O
are	O
read	O
on	O
every	O
request	O
,	O
changes	O
made	O
in	O
these	O
files	O
take	O
immediate	O
effect	O
–	O
as	O
opposed	O
to	O
the	O
main	O
configuration	B-Protocol
file	I-Protocol
,	O
which	O
requires	O
the	O
server	B-Application
to	O
be	O
restarted	O
for	O
the	O
new	O
settings	O
to	O
take	O
effect	O
.	O
</s>
<s>
The	O
use	O
of	O
.htaccess	B-Protocol
files	O
allows	O
such	O
individualization	O
,	O
and	O
by	O
unprivileged	O
users	O
–	O
because	O
the	O
main	O
server	B-Application
configuration	B-Protocol
files	I-Protocol
do	O
not	O
need	O
to	O
be	O
changed	O
.	O
</s>
<s>
Controlling	O
Apache	B-Application
using	O
the	O
main	O
server	B-Application
configuration	B-Protocol
file	I-Protocol
httpd.conf	B-Application
is	O
often	O
preferred	O
for	O
security	O
and	O
performance	O
reasons	O
:	O
</s>
<s>
Performance	O
loss	O
For	O
each	O
HTTP	B-Protocol
request	O
,	O
there	O
are	O
additional	O
file-system	O
accesses	O
for	O
parent	B-Application
directories	I-Application
when	O
using	O
.htaccess	B-Protocol
,	O
to	O
check	O
for	O
possibly	O
existing	O
.htaccess	B-Protocol
files	O
in	O
those	O
parent	B-Application
directories	I-Application
which	O
are	O
allowed	O
to	O
hold	O
.htaccess	B-Protocol
files	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
programatically	O
migrate	O
directives	O
from	O
.htaccess	B-Protocol
to	O
httpd.conf	B-Application
if	O
this	O
performance	O
loss	O
is	O
a	O
concern	O
.	O
</s>
<s>
Security	O
Allowing	O
individual	O
users	O
to	O
modify	O
the	O
configuration	O
of	O
a	O
server	B-Application
can	O
cause	O
security	O
concerns	O
if	O
not	O
set	O
up	O
properly	O
.	O
</s>
<s>
Syntax	O
.htaccess	B-Protocol
is	O
usually	O
very	O
sensitive	O
to	O
syntax	O
errors	O
.	O
</s>
<s>
Due	O
to	O
this	O
any	O
misspellings	O
may	O
lead	O
to	O
server	B-Application
errors	O
and	O
web	O
resources	O
in	O
the	O
directory	B-Application
with	O
the	O
erroneous	O
.htaccess	B-Protocol
not	O
being	O
displayed	O
at	O
all	O
.	O
</s>
<s>
Portions	O
of	O
the	O
2020	O
video	O
game	O
Mackerelmedia	B-Application
Fish	I-Application
,	O
which	O
explores	O
themes	O
of	O
Internet	O
culture	O
,	O
have	O
been	O
implemented	O
directly	O
on	O
a	O
website	O
's	O
open	O
.htaccess	B-Protocol
directories	B-Application
.	O
</s>
