开发者

Change part of the url using url redirect

开发者 https://www.devze.com 2023-02-18 07:57 出处:网络
I have an issue where the image paths in css files need to be changed dynamically. Currently the image links are like url(../../image/image.png) in some css files. In others the links are like url(../

I have an issue where the image paths in css files need to be changed dynamically. Currently the image links are like url(../../image/image.png) in some css files. In others the links are like url(../image/image.png).

I am packing all the css files into one file using pack:tag and as a result, the ../../image/image.png links get broken when accessed from the packed css file as from the packed css file, the correct path becomes ../image/image.png.

I was told that the way to fix the issue is to use url redirect and tuckey but I am unsure about the process. I added the filter in web.xml, but what rule should I add in the urlredirect.xml ? Curr开发者_运维知识库ently it reads:

<rule> <from>.*/behavior/(.*)</from> <to type="forward">/css/$1</to> </rule>


I'd get around that by using absolute references rather than relative. So use url(/yourfolder/image/image.png).

0

精彩评论

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