我有一個網站,比如www.example.com。所以當我訪問「http://www.example.com/program/resources/foo.gif」它服務我foo.gif
圖像從/usr/share/roundcube/program/resources/foo.gif
,我發現在訪問日誌。將單個圖像從一個目錄重定向到另一個目錄
所以我想要做的是,我想該圖像從/usr/share/roundcube/program/resources/
複製到我的根目錄/var/www/www.example.com/webroot/img/
寫重寫規則,這樣,當請求到來的foo.gif
,應該從/var/www/www.example.com/webroot/img
服務不是從/usr/share/roundcube/program/resources/
。
我已經試過這
RewriteEngine On
RewriteRule /program/resources/(.*) /img/$1 [L]
它的正常工作。但是,如果我想要制定一個單一圖像的規則是foo.gif
?
而不是'。*'模式,把文件名:'foo \ .gif'。 – hjpotter92
@ hjpotter92不,它不起作用。它給我404錯誤 – Rahul