Redirect Report

Posted by Community Admin on 04-Aug-2018 19:41

Redirect Report

All Replies

Posted by Community Admin on 06-Mar-2015 00:00

We are trying to find an efficient way to get a list of all of the redirect URLs and the parent page the redirect points to without manually going into the properties of each page.  We are using Sitefinity 6.3. Any thoughts/ideas are appreciated, thanks! 

Posted by Community Admin on 11-Mar-2015 00:00

Hello Rob,

Would you please provide more information about  your needs?

Are you looking for Redirect pages and where they redirects to or additional Urls of the pages?

Regards,
Svetoslav Manchev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 13-Mar-2015 00:00

Hey Svetoslav, 

Thanks for your reply!  We actually need both I believe. 

 1) Under Pages or News, if you select to Edit there is the Allow Multiple URL's for this item... we were hoping to capture those URLs in a report without having to go into the Edit screen of each Page or News article.

 2) We also were hoping there was a way to pull a report for redirects and the pages they redirect to.  

 Apologies for me lack of expertise on the system.  I'm a new employee and first time Sitefinity user :   Thanks!! 

 

Rob

 

Posted by Community Admin on 18-Mar-2015 00:00

Hello Rob,

You can use the API to get the pages (or any other content you need) and iterate them getting the information you need. For example:

var pNodes = GetPages();   
foreach (var node in pNodes)
    var urls = node.Urls;
    var parentPageName = node.Parent.Title;
 
var redirectPageNodes = GetRedirectPages();
foreach (var rp in redirectPageNodes)
    var redirectsToPageId = rp.LinkedNodeId;

and the respective methods:
private IQueryable<PageNode> GetPages()
    var nodes = App.WorkWith()
             .Pages()
             .LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
             .Where(p => p.GetPageData() != null && p.NodeType == NodeType.Standard)
             .ThatArePublished()
             .Get();
 
    return nodes;
 
private IQueryable<PageNode> GetRedirectPages()
    var nodes = App.WorkWith()
             .Pages()
             .LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
             .Where(p => p.NodeType == NodeType.InnerRedirect)
             .ThatArePublished()
             .Get();
 
    return nodes;

You can do the same for New.

More information about Pages and News API is available here and here..

I hope this information helps.

Regards,
Svetoslav Manchev
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed