[RESOLVED]RedirectToAction Versus RedirectToActionPermanent

I am working on an Asp.net MVC web application, and i am trying to understand what is the differences between RedirectToAction & RedirectToActionPermanent ?

for example suppose i have the following http Post Create action method:-

[Post]
Publich ActionResult Create (int id)
{

//code goes here
Return RedirectToAction("Index");
}

so in this case i can not find any differences between using RedirectToAction("Index") & RedirectToActionPermanent("Index") ?

Thanks

They send different response codes to the browser.  301 is a permanent redirect, 302 a temp one.  The end effect is the same, but if the client wants to index links (the most common client that does this will be search engines) then a permanent redirect tells
the client to update its records to ignore the old link and start using the new one.  A temp redirect tells the client that the page is redirecting for now, but not to delete the old link from its indexing database.

Perm redirects are mainly used for when you’re moving pages around and want to leave the old urls intact.

AidyF

They send different response codes to the browser.  301 is a permanent redirect, 302 a temp one.  The end effect is the same, but if the client wants to index links (the most common client that does this will be search engines) then a permanent redirect tells
the client to update its records to ignore the old link and start using the new one.  A temp redirect tells the client that the page is redirecting for now, but not to delete the old link from its indexing database.

Perm redirects are mainly used for when you’re moving pages around and want to leave the old urls intact.

yes this what i meant , i am working on my application which is not exposed to any search engines ,, so mentioning that the redirect is permanent will not have any effect ? is this correct ?

In terms of functionality it makes no different which you use, it really is just for search engines and similar.

AidyF

In terms of functionality it makes no different which you use, it really is just for search engines and similar.

While to an end user the net effect might be the same, they are for different purposes. I’d suggest to stick with 302 — you’re trying to control the workflow the user is going thru, not trying to update search engine indexes.

Leave a Reply