Your idea is right - with those rules to "do nothing" when App_Themes is part of the URL. But your regex is too restrictive. Why not just use App_Themes anywhere in the URL?

# Don't rewrite if it is a static file
RewriteRule App_Themes - [L]

Notice there is no ^ at the beginning of the pattern. the ^ indicates "beginning-of-line" , but you don't want the rule to match only when the URL *begins with* App_Themes, right? You want the "do nothing" rule to match when
App_Themes is anywhere in the URL. I think. I don't know if this will work, but it's closer than what you;ve got.

For more insight, check the IIRF log file and you can see what the incoming URLs look like, and what they are being rewritten to.

Well , the rule I suggested seems to be working VERY well - every URL with App_Themes in it is not rewritten, as you wanted.

I think now, you also want to NOT rewrite URLs that have .gif in them, maybe. But I'm not sure. If that's the case, just insert another pattern that matches on *.gif, and don't rewrite those, either. (USe a replacement pattern of - ).

This is the way to develop rules: you try a set of rules, test the set, tweak the rules, try again, etc. You're getting there.

As you see it acts oddly, it concatenate the "category" path with the real url: "/category/App_Themes/Default/Images/banner_categoria.jpg" is wrong, the
real is "/App_Themes/Default/Images/banner_categoria.jpg"

> As you see it acts oddly, it concatenate the "category" path with the real url: "/category/App_Themes/Default/Images/banner_categoria.jpg" is wrong

Ah, yes, I see.

But the messages in the IIRF log indicate that the incoming URL is wrong. IIRF does not rewrite the URL that way. It arrives that way.

This likely means that your HTML page includes the URL this way. This can happen if you use relative URLs (eg, "~App_Themes/foo/bar/bam.jpg"), rather than absolute ones ("/App_Themes/fo/bar/bam.jpg") .

There are two ways to fix it: One is to make sure the HTML page in question generates proper URLs in the first place. This is the preferred mechanism. The second way is to rewrite from any URL that is broken back to the correct URL. Do this with
an additional URL in IIRF, like so:

RewriteUrl ^/category(/App_Themes.+) $1 [L]

The above rule removes /category prefix from any URL that starts with /category/App_Themes .