question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redirect suffix routes to best path match (introduce canonical PDP URL)

See original GitHub issue

The 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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
neilhubertpricecommented, Nov 1, 2021

@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

0reactions
Platonncommented, Oct 28, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found