Redirect suffix routes to best path match (introduce canonical PDP URL)
See original GitHub issueThe product and category page routes do have the ability to match the /p
or /c
prefix, with any additional prefixes. The route is taken into account, however, the final URL isn’t updated in case of misuse.
There are different use cases where we should come up with a solution:
- In case someone would post a link to
/crazy/company/p/1234
, the product detail page would still fetch the product data and nothing would change. - The product name of the route is not validated against the actual title. If a link to
/p/1234/shitty-product
would be working fine. - The same is true for any of the ContentPages fetched by the CMS backend. One could post a link on twitter to
/corporate/shitty-company
, and the CMS will render the page for/company
.
We should come up with a solution for these use-cases. There’s likely an alternative approach for product or content pages.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Using the Canonical Tag and Redirects to Solve URL ...
301 Redirects. A 301 redirect, or "permanent redirect," is the best practice to solve for known or anticipated URL canonicalization issues.
Read more >NetSuite Applications Suite - N/redirect Module
URL Routing in Commerce Websites · NetSuite Domain-Level Redirects · Redirect Users with ... SCIS Custom Attributes for PDP, Cart, Item, and Customer...
Read more >Redirecting Routes To Maintain Persistent URLs - Haacked
The legacy route should be registered after the new URL to ensure it doesn't accidentally match and supersede the new URL.
Read more >Cisco Secure Firewall Threat Defense Command Reference
The following example shows how to create a capture for control path packets in the clustering link: > capture cp interface cluster match...
Read more >Bison 3.8.1 - GNU.org
Second, consider interactions with the lexer (see Semantic Info in Token Kinds) with great care. Since a split parser consumes tokens without performing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Platonn I would say it is only loosely related to #9681 - that is about URLs that fall through to the catch-all and should generate 404s, whereas this about redirect to canonical URLs where URLs have a correct/valid pattern but some parts of the URL are not current.
https://github.com/SAP/spartacus/issues/5863 which got closed as a duplicate of this talks more specifically about PDP/PLP pages
Related to https://github.com/SAP/spartacus/issues/9681