参照: http://blog.fusic.co.jp/archives/1459
http://example.com/test にアクセスすると
http://example.com/app/webroot/test/ にリダイレクトするのを何とかしたい。
~/app/webroot/.htaccess を改修する。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
↓ 改変
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
RewriteCond %{THE_REQUEST} "^(.+?) (.*?)/app/webroot/(.*?) (.+?)$"
RewriteRule ^(.*?)$ %2/%3 [R=301,L,NE]
</IfModule>