3

I need to resolve page ids to a fully qualified URL for a SEO sitemap. The dynamic linking calls return relative URLs, and I want that for most of the site, except for the SEO sitemap.

Q: Can I get the primary mapped URL though the Content Delivery APIs?

For the sitemap I would just combine the primary mapped URL and the relative page URL from the linking API. The reason I want the primary mapped URLs is because the web servers are behind a load balancer, the protocol, hostname and port from the request are not relevant.

Using CIL API for Web 8.5, publication mappings with Topology manager, and no cd_link_conf.xml.

3

If you ensure your Content Service has a cd_link_conf.xml and set OverrideDiscoveryService="false" (it is set true by default), CD Linking should start generating absolute URLs. It will use the Website Base URL which is configured in Topology Manager.

Note that this doesn't work well if your Website has multiple Base URLs, though (that is why it is set to false by default).

| improve this answer | |
  • I think the OverrideDiscoveryService attribute refers to overriding the mapping information from the discovery service with the Publications section in the cd_link_conf.xml. The docs docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/… mention relative URLs but it sounds like a side effect? – Jan H Mar 13 '17 at 17:07
  • Also, I don't want to make all URLs on the websit fully qualified, it's just about the URLs for the sitemap. – Jan H Mar 13 '17 at 17:28
  • Indeed, getting relative URLs is a (very nice) side-effect of overriding Publication URL mappings coming from Discovery Service (and indirectly from Topology Manager) with mappings specified in cd_link_conf.xml which you then intentionally leave empty. – Rick Pannekoek Mar 13 '17 at 18:22
  • AFAIK, there is no public API to get absolute URLs if CD Linking is configured to use relative URLs. You could get the mappings directly out of the Discovery Service, but there is no official public API for that purpose. – Rick Pannekoek Mar 13 '17 at 18:25

Your Answer

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

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