I am presently creating a website and that i have my local atmosphere that is located with an XP box with IIS 5.1. I am using ASP MVC2 and .Internet Framework 4..

What I wish to know is, if there's a method to "configure" in web.config (or other ways) a path for those my images to ensure that when my CSS uses url() it instantly knows where you can search for.

The primary cause of this is the fact that you will find there's large amount of images and documents that people don't want to keep within our source control as it is not highly relevant to ask them to inside because it changes so much from our content authors.

Supplying a dev and push space to allow them to edit, review and deploy their very own documents is another huge benefit for productivity and I wish to ensure that it stays this way if at all possible as you will find there's mechanism to validate that the files linked within our sites are valid.

So, for instance, on my small dev box, I must use "http://static.devserver/Images/..." however when implementing, I'd like these to use "http://static.productionserver/Images/..."

Clearly, thinking about my needs above, hosting the CSS around the static subdomain would not be exercising within this scenario or possibly I have skipped something?

I have learned to make use of mod_rewrite and/or htaccess but I am not so well recorded about this and appears rather complex for that time I've now to deliver this project.

Overall, I would like everyone available to talk about your ideas and suggestions on ways I possibly could understand this being employed as I referred to it above.

Thanks for reading through!

There's very difficult means to fix just do what you would like. You may have to output .css file like a dynamic page, replacing a string from configuration before each URL( in CSS.

Do you require a subdomain? Why don't you make use of a subfolder? url('/css/yourcss.css') is universal for dev and production.

(Well, I understand you will find difficulties with additional traffic from snacks, but nonetheless, this really is WAAAY simpler to complete)

BarMonster's relative path is what you want. The url('/subfolder/yourfile.ext'). That's the easiest method to do images, and many links inside the site to have the ability to translate between make sure live conditions.

Thanks men for trying that helped me to out! I finally digged again in url spinning to obtain the means to fix my problem! I desired to "redirect" rather than "spinning" the url!

Now it really works as intended!

I am using Intelligencia's URL Rewriter with this particular simple rule:

<rewriter>

        <redirect url="^.+.(?:digitalbmppngpresen)$" to="http://myDEVserver$" processing="stop" />

</rewriter>