以前是使用ln命令創建虛擬文件夾。如何用mod_rewrite創建類似ln -s的虛擬文件夾Unix
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
能幫助我嗎?謝謝
你從來沒有見過一個符號鏈接的框架,所以我認爲它使用mod_rewrite – zetanova
鋰(li3)建議使用資產的符號鏈接。它有一個默認的路由器構建,讓PHP爲開發目的提供所需的文件,但他們建議不要這樣做,因爲它浪費了PHP線程。 – rpkamp