开发者

With mod_rewrite, how do you redirect only images that were stored at the root level to a subdirectory?

I have a site that stored all their images at the root level. I'd like to move the images to a sub directory such as开发者_如何学编程 /media/images and then with mod_rewrite, direct all requests for those images stored at the root level to the ones that have been moved to the directory /media/images?


RewriteRule ^([^/]+)(\.png|\.jpg|\.bmp|\.gif)$ media/images/$1$2

Should work nicely.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜