As the docs said: It is possible to specify alternative user directories:
It is also possible to specify alternative user directories. If you use a command like:
UserDir "public_html" "/usr/web" "http://www.example.com/"
With a request for http://www.example.com/~bob/one/two.html, will try to find the page at ~bob/public_html/one/two.html first, then /usr/web/bob/one/two.html, and finally it will send a redirect to http://www.example.com/bob/one/two.html.
Here is my config (file: /etc/httpd/conf/extra/httpd-userdir.conf
in Arch Linux):
UserDir "public_html" "/run/media/*/web/public_html"
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Require method GET POST OPTIONS
</Directory>
<Directory "/run/media/*/web/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Require method GET POST OPTIONS
</Directory>
But Apache can only find files in directory that listing first (in this case "public_html"
), If I try to access file in next directories, It said Object not found
.
Using only one Userdir is work fine (either "public_html"
or "/run/media/*/web/public_html"
but not both).
Does anyone know what I'm doing wrong?