As described in this blog I want to rewrite internally
http://xy.user.phpfarm.lan -> http://user.phpfarm.lan/~xy/
Module userdir is enabled.
With the following Apache2 vhost config file, it has got a bug:
/etc/apache2/sites-enabled/phpfarm:
<Virtualhost *:80>
ServerAdmin root@localhost
ServerName em-sv-phpfarm.lan
ServerAlias *.user.phpfarm.lan user.phpfarm.lan phpfarm.lan
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteLog "/tmp/rewrites"
RewriteLogLevel 5
# Uncomment the above two lines and watch /tmp for some debug info.
RewriteEngine On
# Make bob.user.phpfarm.em.lan be treated as user.phpfarm.lan/~bob
RewriteCond %{HTTP_HOST} ([^.]+)\.user\.phpfarm\.lan$ [NC]
# In the above line make sure you escape (preceed with a backslash) every period (.) in the address.
RewriteCond %{REQUEST_URI} !^[^/]+/~.*$
# exclude file handler
RewriteCond %{REQUEST_URI} !^/php-fcgi/.*$
RewriteRule ^/([^~]+) /~%1/$1 [PT,L]
</virtualhost>
- http://xy.user.phpfarm.lan lists an index of /var/www, but it should list an index of /home/xy/public_html, that is wrong
- http://xy.user.phpfarm.lan/testfile shows the content of /home/xy/public_html/testfile, that is correct!
So I think an empty REQUEST_URI isn't captured correctly. But I can't find the bug. Does anybody know, why?