UserDirアクセスのリライトルール

ハマった。。。

<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [R]
</IfModule>

と設定して、

http://mydomain/~myuser/abc/def

というふうにアクセスすると、期待するリダイレクトは

http://mydomain/~myuser/index.php/abc/def

なんだけど、

xxx.xxx.xxx.xxx - - [09/Nov/2012:15:02:56 +0900] [mydomain/sid#91564a8][rid#9478e18/initial] (3) [perdir /home/myuser/public_html/] add per-dir prefix: index.php/abc/def -> /home/myuser/public_html/index.php/abc/def
http://mydomain/home/myuser/public_html/index.php/abc/def

となり、物理パスに書き換えられてしまう。。。

RewriteBase /~myuser
RewriteRule ^(.*)$ index.php/$1 [R]
RewriteRule ^(.*)$ /~myuser/index.php/$1 [R]

で期待した結果となる。