开发者

apache mod-rewrite file name change

This is probably straight forward for someone who know apache mod rewrite and regex but that someone is not me. This is what I am looking for : I just want to re-route image开发者_StackOverflow中文版,css requests to one shared repository image/css file. e.g. we have 6-7 sites which can be on same server or different. Currently, image looks like this /img/site1_header.jpg, all I want is that internally this request should become /img/header.jpg so basically remove the variable 'site1' (or site2,site 3)

Any help appreciated.

thanks


I haven't tested it, but I expect it will look something like:

RewriteEngine On
RewriteRule ^(.*)/(site[0-9]*_)(.*)$ $1/$2 [PT,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜