An Adobe Commerce Architect needs to scope a bespoke news section for a merchant's Adobe Commerce storefront. The merchant's SEO agency requests that the following URL structure:
news/{date}/{article_url_key}l where {date} is the publication date of the article, and {article_url_key} is the URL key of the article.
The Architect scopes that a news entity type will be created. The date and URL key data will be stored against each record and autogenerated on save. The values will be able to be manually overridden.
The Architect needs to manage routing this functionality and adhere to best practice.
Which two options should the Architect consider to meet these requirements? (Choose two.)
Correct Answer: D,E
To manage routing for the bespoke news section, the Architect should consider creating a standard controller route and mapping the internal URLs (such as news/article/view/id/1) to rewrites that are generated on save and then stored in the URL rewrites table. This will allow the news articles to have SEO-friendly URLs that match the merchant's requirements. Alternatively, the Architect should consider creating a custom router that runs before the standard router and matches the news portion of the URL, then looks for and loads a news article by matching the date and URL key parts of the URL. This will avoid using the URL rewrites table and provide more flexibility for customizing the routing logic. Option A is incorrect because it will not generate SEO-friendly URLs for the news articles. Option B is incorrect because it will not handle routing at all, but only modify the response after a controller has been executed. Option C is incorrect because it will interfere with the core action execution logic and potentially cause conflicts with other plugins. Reference: https://devdocs.magento.com/guides/v2.4/extension-dev-guide/routing.html https://devdocs.magento.com/guides/v2.4/extension-dev-guide/url-rewrite.html