我想添加一個規則來將jpg文件重定向到超出文檔根目錄的目錄。我已經使用以下內容來重寫沒有文件擴展名的任何內容。url重寫 - 重寫映像路徑到內部文件夾
Options Indexes FollowSymLinks Includes ExecCGI
RewriteEngine On
RewriteBase/
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^[^.]+$ /index.php/$1 [L]
我想實現
http://www.mysite.com/i/image_type/12345.jpg
=>
/internal_path/image_type/12345.jpg
編輯在這種情況下,我結束了使用的符號鏈接。我不確定這是否是最好的解決方案,但它滿足了我的要求。