开发者

htaccess to catch all image requests and redirect to proper folder

how do i redirect all image requests to a specific folder, since my site has some mod rewriting for nicer urls, sometimes when an image is not found it is handled by the main access route, which is wrong, since htaccess should redirect properly.

i already got:

Options +FollowSymlinks
RewriteEngine on

RewriteBase /

RewriteRule ^$       开发者_开发百科                 index.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d

RewriteRule ^([^/]+)/?([^/]*)/?/?([^/]*)/?([^/]*)$ index.php?account=$1&task=$2&object_id=$3&app_type=$4

all image requests should be routed to /public/images/

Thanks in advance.


  RewriteRule (.*)\.(gif|jpg|png)$ /public/images/$1.$2 [R,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜