以前使用命令 ln 创建虚拟文件夹。
cd public
ln -s ../app/assets/ assets
~ public > ls -l
lrwxr-xr-x 1 carlosmontalvo admin 14 May 15 12:21 assets -> ../app/assets/
但我想用 mod_rewrite
我用
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?assets(.*) ../app/assets$1 [P] #here
RewriteRule ^(.*)$ index.php [QSA,L]
但这不起作用
树目录
├── app
│ └─ assets
│ ├── images
│ ├── javascripts
│ │ └── application.js
│ └── stylesheets
│ └── application.css
├── public
│ ├── 404.html
│ ├── 422.html
│ ├── 500.html
│ ├── assets -> ../app/assets/
│ ├── index.php
│ └── robots.txt
可以帮助我吗?谢谢