0

I have a requirement where we need to retain a URL from a legacy system (Umbraco). The way legacy works is a search page that filters search results via query string but in the format of rest API.

e.q. www.mydomain.com/searchpage/A (/A means filtering all names starts with A).

www.mydomain.com/searchpage/A/Aaron (/A/Aaron means filtering all names starts with A along with specific name Aaron.

Is this possible achievable in Sitecore? We are trying not to use rewrite rules in this solution.

Hope this makes sense.

1 Answer 1

2

You could use Sitecore wildcard item(s) to achieve this.

You create a page underneath searchpage and name it "*". Sitecore will map all request that are made to something underneath searchpage (and can't be resolved) to this wildcard item.

The wildcard item itself is actually an item just like any other - so you can put a layout and renderings on it. In these renderings you can access the parameters in the url to use in any logic you need - in this case a (filtered) search result.

Couldn't find any info on the official Sitecore docs, but there are plenty blogs posts on the subject as well.

4
  • Thanks for your reply. I haven't seen that approach. I would appreciate if you can share any article describing the approach. Btw, i have missed to mentioned that the datasource for the search items are stored in xml form not in Sitecore. So my concern really is to how to achieve the url structure.
    – arseny
    Commented Jul 5, 2018 at 14:45
  • Not sure what you mean with "achieving the url structure".. the wildcard will help you resolving the requests but it stops there. If you need more, best is to edit the question or -if this would make the question too broad- create a new one for any other topic.
    – Gatogordo
    Commented Jul 5, 2018 at 15:03
  • Apologies for the confusion, my question really is given www.mydomain.com/searchpage?query1=A;query2=Aaron, i wanted to achieve this into www.mydomain.com/searchpage/A/Aaron in Sitecore where /A is equivalent to ?query1=A and the other /Aaron is equivalent to ;query2=Aaron. Hope this this is clear.
    – arseny
    Commented Jul 6, 2018 at 2:29
  • To resolve the urls, the wildcard will help you. But I have no clue on how you want to generate those links.. you will end up with custom coding, that thing is for sure though.
    – Gatogordo
    Commented Jul 6, 2018 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.