Which is pretty easy to implement Url Rewriter for Asp.Net MVC

I am rewriting some sites in MVC.

I am worried about old links, some of which I know, and some not.

I am looking for suggestions and code examples to make sure my known and unknown links are not dead. What are your options?

In the end, I would like to change the old links. I hope to do this by notifying my users coming from old links of new links.

I want to start with something simple as I am still learning MVC.

Another publication suggested "Managed Fusion URL Rewriter and Reverse Proxy . "

+2
source share
3 answers

I am the developer of the Rewriter URL you were talking about. If you want help, contact me as indicated in the ReadMe.txt file. What you are asking for is not unusual and can be easily done using some very simple rules.

Well, you raised two important points. If you want to notify your users of new links, you are the largest user that Google may be interested in right now. You can solve this problem with Google by running 301 Permanent Redirect . For example, you can do this with the syntax of a Rewriter URL.

 RewriteRule ^/(old-url.*)$ /new-url$1 [R=301] 

R=301 performs a constant call forwarding. The second is your known and unknown links. For your famous links, you just need to match them with the right part of your new application using the rules above. Depending on how many old URLs you have, you probably want to make the rewrite rule general so that you can catch many old URLs.

For unknown links, you probably want to do one of two things, look at your server logs or server analytics for something important, and map them accordingly to the right part of your new code.

Then, to make sure that everyone else hasn’t left completely, you can redirect them either to your home page, or to an internal search on the site, or simply to a shared page explaining that your site has been updated and this link is no longer used.

Again, please contact me with questions. Managed Fusion URL Rewriter and Reverse Proxy will work perfectly with any .NET website (including MVC) on IIS 6 and on any type of website in IIS 7, including PHP, Ruby, JSP and classic ASP.

+4
source

Take a look at this article - http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

SUMMARY: Tip / Trick: Porting URLs using ASP.NET.

http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx

SUMMARY: Blog - ASP.NET MVC Framework (Part 2): URL Routing.

0
source

If you need pretty URLs (or search engine optimization), you can do this without rewriting your application. Check the URL of the Rewrite Module for IIS 7:

http://www.iis.net/extensions/URLRewrite/

It is supported by Microsoft and supports rewriting URLs as well as rewriting response content (for example, to fix application links).

Daniel Vazquez Lopez.

0
source

All Articles