Wednesday, January 7, 2015

Difference Between Response.Redirect, Response.RedirectParmanent

It is the new feature Introducted in .NET 4.0.

Response.RedirectParmanent() is a function introduced in .NET 4.0.


503 - Server is temporary unavailable.

Response.Redirect - Returns 302 
RedirectParmanent - Returns 301.

If you use the Response.Redirect() to redirect from Page 1 to Page 2, 

search engines will keep Page 1 in their index since the Response.Redirect() indicates a temporary redirect. 

In case the original page (Page 1) no longer exists, and Page 2 

should replace Page 1, you need to indicate it with a Response Code 301, thus the Response.RedirectPermanent() method(It redirects permanently to another location. Search engines (such as Google and Bing) will change their indexes to point to the new page directly. ).



Server.Transfer: Server.Transfer will transfer request from Page1.aspx to Page2.aspx and return HTTP response status code 200 (Page found). 

Note:
Response.Redirect() : Search Engine will take this redirection as Temporary(Status 301) and always keep Page1 in its cache.

Response.RedirectParmanent() : Search Engine will take this a permanent redirection(Status 302) and will remove Page1 from its database and include Page2 for better performance on search.

Server.Transfer:
when you are thinking of keeping the page for ever, and to let search engine unaware of this redirection.

Conclusion


Example


You have a page, and which is included to search engine for longer days, if we use Response.Redirect() it will not change this effect to the search engine(taking this a temporary change), while if you use Response.RedirectParmanent() it will take it as permanent.

No comments:

Post a Comment

Thank you for visiting my blog

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...