1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7 This file is generated from xml source: DO NOT EDIT
8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
10 <title>mod_userdir - Apache HTTP Server Version 2.5</title>
11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <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" />
14 <script src="../style/scripts/prettify.min.js" type="text/javascript">
17 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
19 <div id="page-header">
20 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
21 <p class="apache">Apache HTTP Server Version 2.5</p>
22 <img alt="" src="../images/feather.png" /></div>
23 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
25 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.5</a> > <a href="./">Modules</a></div>
26 <div id="page-content">
27 <div id="preamble"><h1>Apache Module mod_userdir</h1>
29 <p><span>Available Languages: </span><a href="../en/mod/mod_userdir.html" title="English"> en </a> |
30 <a href="../fr/mod/mod_userdir.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
31 <a href="../ja/mod/mod_userdir.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
32 <a href="../ko/mod/mod_userdir.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
33 <a href="../tr/mod/mod_userdir.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
35 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User-specific directories</td></tr>
36 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
37 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>userdir_module</td></tr>
38 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_userdir.c</td></tr></table>
41 <p>This module allows user-specific directories to be accessed using the
42 <code>http://example.com/~user/</code> syntax.</p>
44 <div id="quickview"><h3 class="directives">Directives</h3>
46 <li><img alt="" src="../images/down.gif" /> <a href="#userdir">UserDir</a></li>
48 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&list_id=144532&product=Apache%20httpd-2&query_format=specific&order=changeddate%20DESC%2Cpriority%2Cbug_severity&component=mod_userdir">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&component=mod_userdir">Report a bug</a></li></ul><h3>See also</h3>
50 <li><a href="../urlmapping.html">Mapping URLs to the
52 <li><a href="../howto/public_html.html">public_html
54 <li><a href="#comments_section">Comments</a></li></ul></div>
56 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
57 <div class="directive-section"><h2><a name="UserDir" id="UserDir">UserDir</a> <a name="userdir" id="userdir">Directive</a></h2>
58 <table class="directive">
59 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location of the user-specific directories</td></tr>
60 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UserDir <em>directory-filename</em> [<em>directory-filename</em>] ...
62 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
63 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
64 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_userdir</td></tr>
67 <p>The <code class="directive">UserDir</code> directive sets the real
68 directory in a user's home directory to use when a request for a
69 document for a user is received. <em>Directory-filename</em> is
70 one of the following:</p>
73 <li>The name of a directory or a pattern such as those shown
76 <li>The keyword <code>disabled</code>. This turns off
77 <em>all</em> username-to-directory translations except those
78 explicitly named with the <code>enabled</code> keyword (see
81 <li>The keyword <code>disabled</code> followed by a
82 space-delimited list of usernames. Usernames that appear in
83 such a list will <em>never</em> have directory translation
84 performed, even if they appear in an <code>enabled</code>
87 <li>The keyword <code>enabled</code> followed by a
88 space-delimited list of usernames. These usernames will have
89 directory translation performed even if a global disable is
90 in effect, but not if they also appear in a
91 <code>disabled</code> clause.</li>
94 <p>If neither the <code>enabled</code> nor the
95 <code>disabled</code> keywords appear in the
96 <code class="directive">Userdir</code> directive, the argument is treated as a
97 filename pattern, and is used to turn the name into a directory
98 specification. A request for
99 <code>http://www.example.com/~bob/one/two.html</code> will be
103 <tr><th>UserDir directive used</th>
104 <th>Translated path</th></tr>
105 <tr><td>UserDir public_html</td>
106 <td>~bob/public_html/one/two.html</td></tr>
107 <tr><td>UserDir /usr/web</td>
108 <td>/usr/web/bob/one/two.html</td></tr>
109 <tr><td>UserDir /home/*/www</td>
110 <td>/home/bob/www/one/two.html</td></tr>
113 <p>The following directives will send redirects to the client:</p>
116 <tr><th>UserDir directive used</th>
117 <th>Translated path</th></tr>
118 <tr><td>UserDir http://www.example.com/users</td>
119 <td>http://www.example.com/users/bob/one/two.html</td></tr>
120 <tr><td>UserDir http://www.example.com/*/usr</td>
121 <td>http://www.example.com/bob/usr/one/two.html</td></tr>
122 <tr><td>UserDir http://www.example.com/~*/</td>
123 <td>http://www.example.com/~bob/one/two.html</td></tr>
127 <strong>Be careful when using this directive; for instance,
128 <code>"UserDir ./"</code> would map <code>"/~root"</code> to
129 <code>"/"</code> - which is probably undesirable. It is strongly
130 recommended that your configuration include a "<code>UserDir
131 disabled root</code>" declaration. See also the <code class="directive"><a href="../mod/core.html#directory">Directory</a></code> directive and the <a href="../misc/security_tips.html">Security Tips</a> page for
132 more information.</strong>
135 <p>Additional examples:</p>
137 <p>To allow a few users to have <code>UserDir</code> directories, but
138 not anyone else, use the following:</p>
140 <pre class="prettyprint lang-config">UserDir disabled
141 UserDir enabled user1 user2 user3</pre>
144 <p>To allow most users to have <code>UserDir</code> directories, but
145 deny this to a few, use the following:</p>
147 <pre class="prettyprint lang-config">UserDir disabled user4 user5 user6</pre>
150 <p>It is also possible to specify alternative user directories.
151 If you use a command like:</p>
153 <pre class="prettyprint lang-config">UserDir "public_html" "/usr/web" "http://www.example.com/"</pre>
156 <p>With a request for
157 <code>http://www.example.com/~bob/one/two.html</code>, will try to
158 find the page at <code>~bob/public_html/one/two.html</code> first, then
159 <code>/usr/web/bob/one/two.html</code>, and finally it will send a
160 redirect to <code>http://www.example.com/bob/one/two.html</code>.</p>
162 <p>If you add a redirect, it must be the last alternative in the list.
163 Apache httpd cannot determine if the redirect succeeded or not, so if you have
164 the redirect earlier in the list, that will always be the alternative
167 <p>User directory substitution is not active by default in versions
168 2.1.4 and later. In earlier versions, <code>UserDir public_html</code>
169 was assumed if no <code class="directive">UserDir</code>
170 directive was present.</p>
172 <div class="note"><h3>Merging details</h3>
173 <p> Lists of specific enabled and disabled users are replaced, not merged,
174 from global to virtual host scope</p></div>
180 <a href="../howto/public_html.html">Per-user web directories tutorial</a>
185 <div class="bottomlang">
186 <p><span>Available Languages: </span><a href="../en/mod/mod_userdir.html" title="English"> en </a> |
187 <a href="../fr/mod/mod_userdir.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
188 <a href="../ja/mod/mod_userdir.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
189 <a href="../ko/mod/mod_userdir.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
190 <a href="../tr/mod/mod_userdir.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
191 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
192 <script type="text/javascript"><!--//--><![CDATA[//><!--
193 var comments_shortname = 'httpd';
194 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_userdir.html';
196 if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
197 d.write('<div id="comments_thread"><\/div>');
198 var s = d.createElement('script');
199 s.type = 'text/javascript';
201 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
202 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
205 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
207 })(window, document);
208 //--><!]]></script></div><div id="footer">
209 <p class="apache">Copyright 2017 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
210 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
211 if (typeof(prettyPrint) !== 'undefined') {