We are on multi-lingual websites having en-CA and fr-CA languages as well. We defined virtual folder for fr-CA to share the same domain name with en-CA. Hence the en-CA works on www.mywebsite.ca and fr-Ca works on www.mywebsite.ca/cafr, all the pages are coming up fine with correct context language.

Having Solr as search engine, for search listing pages we are using Data API Services having data-api-url like “dataservices/pagename”, which is working fine for all the languages but fr-CA. Reason being when it comes to fr-CA the data api url is not respecting the Virtual Folder as part of the URL and returning en-CA search results.

What I have tried:

I tried adding /cafr to the data api url especially when the current context language is fr-CA but it throws a 404.

How can I force Data API to get the search results in fr-CA by passing the Virtual Folder value?

Any help is much appreciated.

  • Is"dataservices" registered as a web API route ? Dec 5 '18 at 18:08
  • 1
    @VincentLui - thank you for the comment. Yes, they are registered as a web API route in global.asax..
    – Rathan M
    Dec 5 '18 at 18:13
  • Can you please try adding querystring parameter sc_lang=fr-CA and see if that works ? Eg. dataservices/pagename?sc_lang=fr-CA Dec 5 '18 at 19:00
  • Tried adding the query string but no luck, do I need to add the virtual folder value which is /cafr in the data-api url?
    – Rathan M
    Dec 5 '18 at 21:08
  • Can you add some code samples of how you are 1) setting the context language for inbound requests and 2) how you are registering your dataservices route? Dec 5 '18 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.