[bug]: 404 pages don't return 404 status code
See original GitHub issueDescribe the bug
If the visitor enters a non existing URL, the network requests returns a 200 StatusCode while showing the Magento no route page. However it should return a 404 StatusCode
To reproduce
Steps to reproduce the behavior:
- Go to venia.magento.com/venia-bottoms/venia-pants.html?page=1
- Open your Inspect tool
- Go to the network tab
- Change the URL to https://venia.magento.com/venia-bottoms/venia-pantsblabkla
- venia-pantsblabkla returns statusCode 200
Expected behavior
venia-pantsblabkla should return a statuscode 404, which would be consistent with thee 404 page shown by Magento
Screenshots
https://snipboard.io/iowkIO.jpg
Please complete the following device information:
Issue happens on all devices and all Magento PWA Studio versions
Please let us know what packages this bug is in regards to:
-
venia-concept
-
venia-ui
-
pwa-buildpack
-
peregrine
-
pwa-devdocs
-
upward-js
-
upward-spec
-
create-pwa
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
404 vs. Soft 404 Errors: What's The Difference & How To Fix ...
To summarize, the 404 page not found code means there was an error in the browser request because the requested page could not...
Read more >Error 404 not found - What does it mean & how to fix it! - IONOS
Something along the lines of '404 Not Found'. A 404 error is the standardized HTTP status code. The message is sent from the...
Read more >404 Pages Should Not Return 200 Status Codes
If you return a 404, it technically means the page does not exist. If you return a 301, then you say that page...
Read more >How to Fix Error 404 Not Found on Your WordPress Site - Kinsta
The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is...
Read more >How to Find and Fix 404 Errors - Neil Patel
A 404 error is a code that indicates a requested page cannot be found. Whenever a page loads in a browser, it has...
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
@anthoula even if this is expected behavior, wouldn’t it harmful for SEO scores when using PWA Studio? I cannot Imagine crawlers liking a status 200 whilst the page content clearly states its not found.
The way I understand it, is that upward resolves the route and during component render the call goes out to
ResolveURL
. Which, imho, is actually to late, because at that point we’d already gotten a 200. Wouldn’t it make more sense to callResolveURL
during in a middleware thats baked in upward (as far as I see upward uses express, so technically that should be possible to do)?This is def. something which is not optimal for SEO. Google might identify those pages as “soft 404” but honestly this is something which is not an expected behaviour for a crawler. Would this be in https://github.com/magento/pwa-studio/blob/develop/packages/upward-js/lib/resolvers/UrlResolver.js ?