404 response code for pages with spaces in the name


Description

Layout queries to Experience Edge Delivery API might return a 404 response code.

For example:

query {
  layout(site: "custom", language: "en", routePath: "/about-us") {
    item {
      rendered
    }
  }
}

The issue commonly occurs for pages with a white space in the name and it is caused by the discrepancy between the item name and the URL.

For example, the item name is About Us, and the URL for the item is /about-us.

Solution

To resolve the issue, consider one of the following options: