开发者

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

开发者 https://www.devze.com 2023-03-20 07:44 出处:网络
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\");

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 serve开发者_运维百科r (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?


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.

0

精彩评论

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