如何路由URL从传统的ASP到MVC应用程序 [英] How to route URL from classic asp to MVC application

查看:132
本文介绍了如何路由URL从传统的ASP到MVC应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从很长一段时间运行的现有ASP应用程序和许多客户用于从表格邮寄或阿贾克斯后采用不同的技术(例如.PHP,.ASP,.ASPX)发布。现在我们正在计划升级的ASP应用程序MVC5。由于URL的修改和现有的URL不可用他们得到404错误。

I have an existing asp application which is running from a long time and many clients used to post the from Form Post or Ajax post with different technologies (e.g. .Php, .Asp, .Aspx). now we are planning to upgrade the asp application to MVC5. As URL’s are modified and existing URL’s are not available they are getting 404 error.

任何人都可以知道如何路由的URL从ASP到MVC。下面是我的榜样。

Can anyone know how to route the URL from asp to MVC. Below is my example

http://bbbbbb.com/test/test/mytest.asp

http://newsite.com/mycontoller/myaction

推荐答案

这可能不是你正在寻找的答案,但我们使用永久重定向。只需更换code在 http://bbbbbb.com/test/test/mytest.asp 的有:

This may not be the answer you are looking for, but we use permanent redirection. Just replace the code in http://bbbbbb.com/test/test/mytest.asp with:

<%
    Response.Status = "301 Moved Permanently"
    Response.AddHeader "Location", "http://newsite.com/mycontoller/myaction"
%>

这篇关于如何路由URL从传统的ASP到MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆