Fully dynamic product URL leads to 404 for other pages that matches the number of URL params/segments
See original GitHub issueEnvironment Details
- Spartacus: 1.4
- Browser: Chrome
- OS: Mac
Steps to Reproduce
Configure the product route to be fully dynamic like so
ConfigModule.withConfig({
routing: {
routes: {
product: {
paths: [
':category/:name/:productCode',
]
}
}
}
})
Observed Results
Any URL that has 3 segments is considered by Spartacus as a product page even when they are not.
For example, the following routes will result in a 404 because Spartacus thinks they are all product pages.
URL | Actual | Expected |
---|---|---|
/category/bags/shoulder-bags | 404 | Category Page |
/cmspage/string/random | 404 | Content Page |
/store-finder/country/US | 404 | Store Locator |
Expected Results
There should be a way to have more specific route matchers.
At a minimum, there should be documentation guideline that having a fully dynamic URL is not possible or recommended.
Offer to Fix
No
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Dynamic URL Parameters + Woocommerce create 404 errors
Hi Guys, Our latest Moz crawl shows a lot of 404-errors for pages that create dynamical links for users? (I guess it are...
Read more >React-router URLs don't work when refreshing or writing ...
But that would give 404 errors for all other URLs when requested from the server. Those same URLs work fine on the client-side,...
Read more >Page Indexing report - Search Console Help - Google Support
View data about indexed pages link shows historical information about your indexed page count, as well as an example list of up to...
Read more >ASP.NET Core Blazor routing and navigation - Microsoft Learn
An Id route segment is present in the request URL. The Id segment is an integer ( int ) type. Pages/User.razor : razor...
Read more >URL Canonicalization and the Canonical Tag | Documentation
What is a canonical URL? A canonical URL is the URL of the page that Google thinks is most representative from a set...
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
Thanks, @plabadie ,
I’m glad to see that you are already working on this feature planned for 2.0.
Our use case is 1 & 3.
For 1, we will make use of the workaround you provided while we wait for the proper solution that will come with 2.0.
For 3, I was thinking of a similar solution to solve our issue relating to duplicate pages
Understood, thanks @Platonn for the write-up.