Search code examples
asp.net-mvcrsspiranha-cms

Change or turn off the default rss in Piranha cms


I have created a website with piranha CMS and a custom routing class. The links in the RSS flow is now broken. Can I change or turn off the default RSS solution?

I tried to solve this problem by creating a controller that returns an RSS feed with the correct links. In RouteConfig I added this map route:

routes.MapRoute (
                 name: "rss"
                 url: 'rss'
                 defaults: new {controller = "RSS", action = "Index"},
                 namespaces: new [] {"onceuponatime.Controllers"}
             );

But when http://mywebsite.com/rss called, it's still the default solution that is shown.


Solution

  • When the application starts a number of default request handlers are registered, among them the RssHandler. You can disable it by adding the following statement in you startup code, like Global.asax.cs:

    Piranha.Application.Current.Handlers.Remove("RSS") ;
    

    This will disable the default implementation and let you handle calls for /rss yourself.