File: /opt/bitnami/apache/manual/howto/htaccess.html.en
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<!--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This file is generated from xml source: DO NOT EDIT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-->
<title>Apache HTTP Server Tutorial: .htaccess files - Apache HTTP Server Version 2.4</title>
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet">
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size">
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css"><link rel="stylesheet" type="text/css" href="../style/css/prettify.css">
<script src="../style/scripts/prettify.min.js">
</script>
<link href="../images/favicon.png" rel="shortcut icon"></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p>
<p class="apache">Apache HTTP Server Version 2.4</p>
<img alt="" src="../images/feather.png"></div>
<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif"></a></div>
<div id="path">
<a href="https://www.apache.org/">Apache</a> > <a href="https://httpd.apache.org/">HTTP Server</a> > <a href="https://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">How-To / Tutorials</a></div><div id="page-content"><div id="preamble"><h1>Apache HTTP Server Tutorial: .htaccess files</h1>
<button aria-label="Toggle language list" class="lang-toggle"><svg xmlns="http://www.w3.org/2000/svg" stroke-width="2" stroke="currentColor" fill="none" viewBox="0 0 24 24" height="16" width="16"><circle r="10" cy="12" cx="12"/><line y2="12" x2="22" y1="12" x1="2"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg></button>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/howto/htaccess.html" title="English"> en </a> |
<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> |
<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p>
</div>
<p><code>.htaccess</code> files provide a way to make configuration
changes on a per-directory basis, without modifying the main server
configuration files directly.</p>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif"> <a href="#related">.htaccess files</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#what">What they are/How to use them</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#when">When (not) to use .htaccess files</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#how">How directives are applied</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#auth">Authentication example</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#ssi">Server Side Includes example</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#rewrite">Rewrite Rules in .htaccess files</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#cgi">CGI example</a></li>
<li><img alt="" src="../images/down.gif"> <a href="#troubleshoot">Troubleshooting</a></li>
</ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="related">.htaccess files <a title="Permanent link" href="#related" class="permalink">¶</a></h2>
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="../mod/core.html">core</a></code></li><li><code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code></li><li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li><li><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li><li><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverridelist">AllowOverrideList</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code></li><li><code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li></ul></td></tr></table>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="what">What they are/How to use them <a title="Permanent link" href="#what" class="permalink">¶</a></h2>
<p><code>.htaccess</code> files (or "distributed configuration files")
provide a way to make configuration changes on a per-directory basis. A
file, containing one or more configuration directives, is placed in a
particular document directory, and the directives apply to that
directory, and all subdirectories thereof.</p>
<div class="note"><h3>Note:</h3>
<p>If you want to call your <code>.htaccess</code> file something
else, you can change the name of the file using the <code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code> directive. For example,
if you would rather call the file <code>.config</code> then you
can put the following in your server configuration file:</p>
<pre class="prettyprint lang-config">AccessFileName ".config"</pre>
</div>
<p>Directives in <code>.htaccess</code> files use the same syntax as
in the <a href="../configuring.html#syntax">main configuration
files</a>. What you are permitted to put in these files is determined by the
<code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> and
<code class="directive"><a href="../mod/core.html#allowoverridelist">AllowOverrideList</a></code> directives.
<code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> specifies, in
categories, what directives will be honored if they are found in a
<code>.htaccess</code> file, while <code class="directive"><a href="../mod/core.html#allowoverridelist">AllowOverrideList</a></code> names individual
directives to permit (see <a href="#when">below</a>). If a directive
is permitted, the documentation for that directive will contain an Override section,
specifying what value must be in <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> in order for that
directive to be permitted.</p>
<div class="note">The default value of <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> is <code>None</code>.
This means <code>.htaccess</code> files are completely ignored
unless you explicitly enable them for a directory.</div>
<p>For example, if you look at the documentation for the <code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code>
directive, you will find that it is permitted in <code>.htaccess</code>
files. (See the Context line in the directive summary.) The <a href="../mod/directive-dict.html#Context">Override</a> line reads
<code>FileInfo</code>. Thus, you must have at least
<code>AllowOverride FileInfo</code> in order for this directive to be
honored in <code>.htaccess</code> files.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="when">When (not) to use .htaccess files <a title="Permanent link" href="#when" class="permalink">¶</a></h2>
<p>If you have access to the main server configuration file, you
should put all of your configuration there instead of in
<code>.htaccess</code> files. This includes user authentication,
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> rules, and anything else you might be
tempted to put in <code>.htaccess</code>. Directives in the main
configuration are loaded once at server start, rather than on every
request, and <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> in particular works better
in server configuration context.</p>
<p><code>.htaccess</code> files should be used in a case where the
content providers need to make configuration changes to the server on a
per-directory basis, but do not have root access on the server system.
This is common with managed hosting environments, control-panel-based
hosting (such as cPanel or Plesk), and content management systems where
the application ships a <code>.htaccess</code> file as part of its
distribution. In the event that the server administrator is not willing
to make frequent configuration changes, it might be desirable to permit
individual users to make these changes in <code>.htaccess</code> files
for themselves.</p>
<p>There are two reasons to prefer the main configuration file
over <code>.htaccess</code>: performance and security.</p>
<p><strong>Performance:</strong> When <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>
is set to allow the use of <code>.htaccess</code> files, httpd will
look in every directory for <code>.htaccess</code> files. Thus,
permitting <code>.htaccess</code> files causes a performance hit,
whether or not you actually even use them! Also, the
<code>.htaccess</code> file is loaded every time a document is
requested.</p>
<p>Further note that httpd must look for <code>.htaccess</code> files
in all higher-level directories, in order to have a full complement of
directives that it must apply. (See section on <a href="#how">how
directives are applied</a>.) Thus, if a file is requested out of a
directory <code>/www/htdocs/example</code>, httpd must look for the
following files:</p>
<pre class="prettyprint lang-config">/.htaccess
/www/.htaccess
/www/htdocs/.htaccess
/www/htdocs/example/.htaccess</pre>
<p>And so, for each file access out of that directory, there are 4
additional file-system accesses, even if none of those files are
present. (Note that this would only be the case if
<code>.htaccess</code> files were enabled for <code>/</code>, which
is not usually the case.)</p>
<p><strong>Security:</strong> You are permitting
users to modify server configuration, which may result in changes over
which you have no control. Carefully consider whether you want to give
your users this privilege. Note also that giving users less
privileges than they need will lead to additional technical support
requests. Make sure you clearly tell your users what level of
privileges you have given them. Specifying exactly what you have set
<code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> to, and pointing them
to the relevant documentation, will save yourself a lot of confusion
later.</p>
<p>If you need to grant <code>.htaccess</code> access but want to
limit it to specific directives rather than entire categories, use the
<code class="directive"><a href="../mod/core.html#allowoverridelist">AllowOverrideList</a></code> directive. This
lets you name individual directives that are permitted, providing
finer-grained control than <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> alone:</p>
<pre class="prettyprint lang-config"># Allow only specific directives, not entire categories
AllowOverride None
AllowOverrideList Redirect RedirectMatch RewriteEngine RewriteRule RewriteCond</pre>
<p>With this configuration, any directive not explicitly listed will
cause a server error if encountered in a <code>.htaccess</code> file.
This is a useful middle ground between full override access and no
override access.</p>
<p>Note that it is completely equivalent to put a <code>.htaccess</code>
file in a directory <code>/www/htdocs/example</code> containing a
directive, and to put that same directive in a Directory section
<code><Directory "/www/htdocs/example"></code> in your main server
configuration:</p>
<p><code>.htaccess</code> file in <code>/www/htdocs/example</code>:</p>
<div class="example"><h3>Contents of .htaccess file in
<code>/www/htdocs/example</code></h3><pre class="prettyprint lang-config">AddType text/example ".exm"</pre>
</div>
<div class="example"><h3>Section from your <code>httpd.conf</code>
file</h3><pre class="prettyprint lang-config"><Directory "/www/htdocs/example">
AddType text/example ".exm"
</Directory></pre>
</div>
<p>The use of <code>.htaccess</code> files can be disabled completely
by setting the <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>
directive to <code>none</code>:</p>
<pre class="prettyprint lang-config">AllowOverride None</pre>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="how">How directives are applied <a title="Permanent link" href="#how" class="permalink">¶</a></h2>
<p>The configuration directives found in a <code>.htaccess</code> file
are applied to the directory in which the <code>.htaccess</code> file
is found, and to all subdirectories thereof. However, it is important
to also remember that there may have been <code>.htaccess</code> files
in directories higher up. Directives are applied in the order that they
are found. Therefore, a <code>.htaccess</code> file in a particular
directory may override directives found in <code>.htaccess</code> files
found higher up in the directory tree. And those, in turn, may have
overridden directives found yet higher up, or in the main server
configuration file itself.</p>
<p>Example:</p>
<p>In the directory <code>/www/htdocs/example1</code> we have a
<code>.htaccess</code> file containing the following:</p>
<pre class="prettyprint lang-config">Options +ExecCGI</pre>
<p>(Note: you must have "<code>AllowOverride Options</code>" in effect
to permit the use of the "<code class="directive"><a href="../mod/core.html#options">Options</a></code>" directive in
<code>.htaccess</code> files.)</p>
<p>In the directory <code>/www/htdocs/example1/example2</code> we have
a <code>.htaccess</code> file containing:</p>
<pre class="prettyprint lang-config">Options Includes</pre>
<p>Because of this second <code>.htaccess</code> file, in the directory
<code>/www/htdocs/example1/example2</code>, CGI execution is not
permitted, as only <code>Options Includes</code> is in effect, which
completely overrides any earlier setting that may have been in
place.</p>
<h3 id="merge">Merging of .htaccess with the main
configuration files</h3>
<p>As discussed in the documentation on <a href="../sections.html">Configuration Sections</a>,
<code>.htaccess</code> files can override the <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> sections for
the corresponding directory, but will be overridden by other types
of configuration sections from the main configuration files. This
fact can be used to enforce certain configurations, even in the
presence of a liberal <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> setting. For example, to
prevent script execution while allowing anything else to be set in
<code>.htaccess</code> you can use:</p>
<pre class="prettyprint lang-config"><Directory "/www/htdocs">
AllowOverride All
</Directory>
<Location "/">
Options +IncludesNoExec -ExecCGI
</Location></pre>
<div class="note">This example assumes that your <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> is <code>/www/htdocs</code>.</div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="auth">Authentication example <a title="Permanent link" href="#auth" class="permalink">¶</a></h2>
<p>As with any <code>.htaccess</code> use, placing these directives in
a <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> block is
preferred when you have access to the main configuration (see
<a href="#when">above</a>). The following example shows the
<code>.htaccess</code> approach:</p>
<p><code>.htaccess</code> file contents:</p>
<pre class="prettyprint lang-config">AuthType Basic
AuthName "Password Required"
AuthUserFile "/www/passwords/password.file"
AuthGroupFile "/www/passwords/group.file"
Require group admins</pre>
<p>Note that <code>AllowOverride AuthConfig</code> must be in effect
for these directives to have any effect.</p>
<p>Please see the <a href="auth.html">authentication tutorial</a> for a
more complete discussion of authentication and authorization.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="ssi">Server Side Includes example <a title="Permanent link" href="#ssi" class="permalink">¶</a></h2>
<p>Another use of <code>.htaccess</code> files is to enable Server Side
Includes for a particular directory. This may be done with the following
configuration directives, placed in a <code>.htaccess</code> file in
the desired directory:</p>
<pre class="prettyprint lang-config">Options +Includes
AddType text/html "shtml"
AddHandler server-parsed shtml</pre>
<p>Note that <code>AllowOverride Options</code> and <code>AllowOverride
FileInfo</code> must both be in effect for these directives to have any
effect.</p>
<p>Please see the <a href="ssi.html">SSI tutorial</a> for a more
complete discussion of server-side includes.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="rewrite">Rewrite Rules in .htaccess files <a title="Permanent link" href="#rewrite" class="permalink">¶</a></h2>
<p>When using <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> in
<code>.htaccess</code> files, be aware that the per-directory context
changes things a bit. In particular, rules are taken to be relative to
the current directory, rather than being the original requested URI.
Consider the following examples:</p>
<pre class="prettyprint lang-config"># In httpd.conf
RewriteRule "^/images/(.+)\.jpg" "/images/$1.png"
# In .htaccess in root dir
RewriteRule "^images/(.+)\.jpg" "images/$1.png"
# In .htaccess in images/
RewriteRule "^(.+)\.jpg" "$1.png"</pre>
<p>In a <code>.htaccess</code> in your document directory, the leading
slash is removed from the value supplied to <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>, and in the
<code>images</code> subdirectory, <code>/images/</code> is removed from
it. Thus, your regular expression needs to omit that portion as
well.</p>
<p>Also note that in <code>.htaccess</code> context, regular expressions are
recompiled on every request, whereas in the main server configuration they
are compiled once and cached.</p>
<p>Consult the <a href="../rewrite/">mod_rewrite documentation</a> for
further details on using <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="cgi">CGI example <a title="Permanent link" href="#cgi" class="permalink">¶</a></h2>
<div class="note">CGI scripts are a legacy mechanism for dynamic content. For new
deployments, consider using <code class="module"><a href="../mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code> with a
FastCGI application server, or a framework-specific handler. The
information below remains useful for environments that still rely on
traditional CGI.</div>
<p>You may wish to use a <code>.htaccess</code> file to permit the
execution of CGI programs in a particular directory. This may be
implemented with the following configuration:</p>
<pre class="prettyprint lang-config">Options +ExecCGI
AddHandler cgi-script "cgi" "py"</pre>
<p>Alternately, if you wish to have all files in the given directory be
considered to be CGI programs, this may be done with the following
configuration:</p>
<pre class="prettyprint lang-config">Options +ExecCGI
SetHandler cgi-script</pre>
<p>Note that <code>AllowOverride Options</code> and <code>AllowOverride
FileInfo</code> must both be in effect for these directives to have any
effect.</p>
<p>Please see the <a href="cgi.html">CGI tutorial</a> for a more
complete discussion of CGI programming and configuration.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div>
<div class="section">
<h2 id="troubleshoot">Troubleshooting <a title="Permanent link" href="#troubleshoot" class="permalink">¶</a></h2>
<p>When you put configuration directives in a <code>.htaccess</code>
file, and you don't get the desired effect, there are a number of
things that may be going wrong.</p>
<p>Most commonly, the problem is that <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> is not
set such that your configuration directives are being honored. Make
sure that you don't have a <code>AllowOverride None</code> in effect
for the file scope in question. A good test for this is to put a
nonsense word in your <code>.htaccess</code> file and reload the
page:</p>
<pre class="prettyprint lang-config">TestMe</pre>
<p>If a server error (HTTP 500) is
not generated, then you almost certainly have <code>AllowOverride
None</code> in effect.</p>
<p>If, on the other hand, you are getting server errors when trying to
access documents, check your httpd error log. It will likely tell you
that the directive used in your <code>.htaccess</code> file is not
permitted.</p>
<pre class="prettyprint lang-config">[Tue May 06 09:12:31.528374 2025] [core:alert] [pid 12345] [client 192.168.1.50:54321] /var/www/html/.htaccess: DirectoryIndex not allowed here</pre>
<p>This will indicate either that you've used a directive that is
never permitted in <code>.htaccess</code> files, or that you simply
don't have <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> set to
a level sufficient for the directive you've used. Consult the
documentation for that particular directive to determine which is
the case.</p>
<p>Alternately, it may tell you that you had a syntax error in your
usage of the directive itself.</p>
<pre class="prettyprint lang-config">[Tue May 06 09:14:02.946218 2025] [core:alert] [pid 12345] [client 192.168.1.50:54321] /var/www/html/.htaccess: RewriteCond: bad flag delimiters</pre>
<p>In this case, the error message should be specific to the
particular syntax error that you have committed.</p>
</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/howto/htaccess.html" title="English"> en </a> |
<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> |
<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p>
</div><div id="footer">
<p class="apache">Copyright 2026 The Apache Software Foundation.<br>Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p></div><script><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
prettyPrint();
}
var langToggle = document.querySelector('.lang-toggle');
var topLang = document.querySelector('.toplang');
if (langToggle && topLang) {
langToggle.addEventListener('click', function() { topLang.classList.toggle('open'); });
}
var qv = document.getElementById('quickview');
if (qv) {
document.body.appendChild(qv);
var qvBtn = document.createElement('button');
qvBtn.className = 'qv-toggle';
qvBtn.setAttribute('aria-label', 'Toggle page navigation');
qvBtn.innerHTML = '☰';
document.body.appendChild(qvBtn);
qvBtn.addEventListener('click', function() {
var isOpen = qv.classList.toggle('open');
if (isOpen) {
qv.style.top = window.scrollY + 10 + 'px';
}
});
window.addEventListener('scroll', function() { qv.classList.remove('open'); });
}
//--><!]]></script>
</body></html>