Michiel Cornille
Michiel Cornille

Reputation: 2097

Many large projects, routing for image server asp.NET mvc

I work in a company that has over 70 asp.net mvc projects (very similar ones)

All images are linked like this : Url.Content("~/imagefoldername/picname.jpg");

Now I want to merge those 70 projects into one, very similar to Drupals multiple-site per installation system.

I'd like to have all images on one server (maybe with the possibility of even using a CDN)

I'm wondering if it's possible to somehow Route /imagefoldername/picname.jpg to something like

http://img.mycdnname.com/project1/picname.jpg

This way I don't need to iterate trough all views int the 70 projects, but just add a rule to global.asax, and would save me a lot of time.

Is it possible? How do I route it?

Upvotes: 0

Views: 247

Answers (1)

Jakub Konecki
Jakub Konecki

Reputation: 46008

You could use IIS URL Rewriting module or just setup separate route in MVC and create an action that will return HTTP 302.

Make sure that you read this article by Phil Haack first.

Upvotes: 2

Related Questions