<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>htaccess file</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="../style.css" type="text/css" /> <link rel="stylesheet" href="../local.css" type="text/css" /> </head> <body> <div class="page"> <div class="pageheader"> <div class="header"> <span> <span class="parentlinks"> <a href="../index.html">ikiwiki</a>/ <a href="../tips.html">tips</a>/ </span> <span class="title"> htaccess file </span> </span> </div> </div> <div id="pagebody"> <div id="content" role="main"> <p>If you try to include a <code>.htaccess</code> file in your wiki's source, in order to configure the web server, you'll find that ikiwiki excludes it from processing. In fact, ikiwiki excludes any file starting with a dot, as well as a lot of other files, for good security reasons.</p> <p>You can tell ikiwiki not to exclude the .htaccess file by adding this to your setup file:</p> <pre><code>include => '^\.htaccess$', </code></pre> <p>Caution! Before you do that, please think for a minute about who can edit your wiki. Are attachment uploads enabled? Can users commit changes directly to the version control system? Do you trust everyone who can make a change to not do Bad Things with the htaccess file? Do you trust everyone who <em>might</em> be able to make a change in the future? Note that a determined attacker who can write to the htaccess file can probably get a shell on your web server.</p> <p>If any of these questions have given you pause, I suggest you find a different way to configure the web server. One way is to not put the <code>.htaccess</code> file under ikiwiki's control, and just manually install it in the destdir. --<span class="createlink">Joey</span></p> <p><a href="http://httpd.apache.org/docs/2.2/howto/htaccess.html">Apache's documentation</a> says:</p> <blockquote> <p>In general, you should never use .htaccess files unless you don't have access to the main server configuration file.</p> </blockquote> </div> </div> <div id="footer" class="pagefooter" role="contentinfo"> <div id="pageinfo"> <div class="pagedate"> Last edited <span class="date">Tue Feb 26 23:01:54 2019</span> <!-- Created <span class="date">Sun Mar 14 18:58:13 2010</span> --> </div> </div> <!-- from ikiwiki --> </div> </div> </body> </html>