301 Redirect
Just wondering about the most effective way to execute a 301 redirect using the Sitefinity platform?
We have a new website going live and we require to permanent redirect around 79 pages of old content to their corresponding new pages.
Dear Andy
If the old pages were .aspx as well, what would happen if you add the old url as an extra url to the new page?
Markus
Hello,
Redirect can be called by assigning additional urls to pages. To do so go to a page, expand Actions menu and then select Title & Properties. Enter additional urls for this page by ckecking Allow Additional Url checkbox. Note you can`t have additional url same as the page url.
Onother way is to use this redirect widget I have attached. You can change the status code in its code behind.
To register the widget refer to this documentation.
Hi Stanislav,
Many thanks for the reply.
Will assigning numerous URL's to a single page still be a 301 permanent redirect?
Andy
Hello,
Yes they will all be 301. In the control I attached I specify the status code.
if
(!HttpContext.Current.Request.Url.ToString().Contains(
"/Action/Edit"
))
Response.StatusCode = 301;
Response.AddHeader(
"Location"
, RedirectString);
Hi Stanislav,
I do not really understand what you are saying. So I have a page/url that I want to delete. I want a redirection of that url to avoid the 404. So what I do is delete the page (url) then add that url to the page I want it to forward (301) to?
and I can undo that be reversing that proces? Delete the url assigned to page, add the page, set the url?
ps the link to the documentation gives a 404 :o)
Thanks,
Vincent
Hello,
To avoid 404 when navigating to non existent url configure asp.net custom error pages in web.config
If you want to remove a page and make sitefinity redirect to predefined page add additional url to the page that will be shown when a user requests a page that doesn`t exist any more, to add additional url to a page choose a page and edit its Title and Properties, in the title and properties dialog add additional url to this page, here is a screenshot.
Here is the documentation link, its fixed in my previous post too.
Regards,
Stanislav Velikov
Telerik