19 Jul 2013
27 Aug 2013
Link to this post
We currently have a custom widget with an Index Action. The widget is placed on a page (let's call the page: "page-containing-the-widget" for argument's sake). The action takes a parameter of "somevalue". The "somevalue" parameter is passed into the action and drives the content. This all works fine and our URL is as follows:
Simple. However, for SEO and for the sake of having /nice/clean/urls, we want to remove the Index part of the URL. As far as I can see there are 4 solutions to this, each with their own set of issues:
1. Change the action name - this isn't preferable as it still give us an unnecessary URL part and also requires that all other widgets use the same UrlKeyPrefix
2. Use the query string - according to this blog post http://www.sitefinity.com/blogs/slavoingilizov/posts/slavo-ingilizovs-blog/2011/12/12/url_filtering_in_built-in_content_widgets this seems to be the way Sitefinity recommend doing it. Again, this is not preferable as we want to do-away with query string params.
3. Set up a custom route - having following several blog posts and discussions and still failing to achieve this, I'm wondering if it's possible to tap into the Sitefinity routing rules in hybrid mode?
4. Use a non-dynamic solution such as IIS rewrite rules or simply doing away with the "somevalue" part of the URL and creating pages for each separate content item - this is definitely not a route [kind of pun intended] we want to go down for obvious reasons.
It seems like something which may need to be done fairly often. In short I don't want a UrlKeyPrefix at all. I just want our content editors to be able to create a page, drag the widget on and then navigate to the url /page-containing-the-widget/somevalue where "somevalue" is pulled in as the url param.
Does anyone have any advice on this?