2 <?xml-stylesheet type="text/xsl" href="../style/manual.xsl"?>
5 <name>mod_userdir</name>
7 <description>This module provides for user-specific
8 directories.</description>
9 <identifier>userdir_module</identifier>
10 <sourcefile>mod_userdir.c</sourcefile>
19 <description>Sets the directory from which to serve files when requests
20 for a particular user are received, denoted by requests containing
21 <em>~username</em>, such as
22 <em>http://server.example.com/~bob/</em></description>
23 <syntax>UserDir <em>directory-filename</em></syntax>
24 <default>UserDir <em>public_html</em></default>
25 <contextlist><context>server config</context> <context>virtual
26 host</context></contextlist>
27 <compatibility>All forms except the <code>UserDir public_html</code>
28 form are only available in Apache 1.1 or above. Use of the
29 <code>enabled</code> keyword, or <code>disabled</code> with a
30 list of usernames, is only available in Apache 1.3 and
31 above.</compatibility>
35 <p>The <directive>UserDir</directive> directive sets the real
36 directory in a user's home directory to use when a request for a
37 document for a user is received. <em>Directory-filename</em> is
38 one of the following:</p>
41 <li>The name of a directory or a pattern such as those shown
44 <li>The keyword <code>disabled</code>. This turns off
45 <em>all</em> username-to-directory translations except those
46 explicitly named with the <code>enabled</code> keyword (see
49 <li>The keyword <code>disabled</code> followed by a
50 space-delimited list of usernames. Usernames that appear in
51 such a list will <em>never</em> have directory translation
52 performed, even if they appear in an <code>enabled</code>
55 <li>The keyword <code>enabled</code> followed by a
56 space-delimited list of usernames. These usernames will have
57 directory translation performed even if a global disable is
58 in effect, but not if they also appear in a
59 <code>disabled</code> clause.</li>
62 <p>If neither the <code>enabled</code> nor the
63 <code>disabled</code> keywords appear in the
64 <code>Userdir</code> directive, the argument is treated as a
65 filename pattern, and is used to turn the name into a directory
66 specification. A request for
67 <code>http://www.foo.com/~bob/one/two.html</code> will be
71 <tr><th>UserDir directive used</th>
72 <th>Translated path</th></tr>
73 <tr><td>UserDir public_html</td><td>~bob/public_html/one/two.html</td></tr>
74 <tr><td>UserDir /usr/web</td><td>/usr/web/bob/one/two.html</td></tr>
75 <tr><td>UserDir /home/*/www</td><td>/home/bob/www/one/two.html</td></tr>
78 <p>The following directives will send redirects to the client:</p>
81 <tr><th>UserDir directive used</th>
82 <th>Translated path</th></tr>
83 <tr><td>UserDir http://www.foo.com/users</td><td>http://www.foo.com/users/bob/one/two.html</td></tr>
85 http://www.foo.com/*/usr</td><td>http://www.foo.com/bob/usr/one/two.html</td></tr>
87 http://www.foo.com/~*/</td><td>http://www.foo.com/~bob/one/two.html</td></tr>
91 <strong>Be careful when using this directive; for instance,
92 <code>"UserDir ./"</code> would map
93 <code>"/~root"</code> to <code>"/"</code> - which is probably
94 undesirable. If you are running Apache 1.3 or above, it is
95 strongly recommended that your configuration include a
96 "<code>UserDir disabled root</code>" declaration.
97 See also the <directive module="core">Directory</directive>
98 directive and the <a href="../misc/security_tips.html">Security
99 Tips</a> page for more information.</strong>