How to send 404 HTTP status code with Polymer Starter Kit

76 Views Asked by At

When starting a new project with the polymer starter kit 2, it comes with decent client side routing based on the PRPL pattern as described here.

This works fine on the front end for the end user. However, on requesting a page that does not exist, there is no proper 404 status code sent. This is not good for SEO, in my understanding.

Is there a recommended way of doing this properly? I understand there needs to be some server side logic to determine what response code to send, but I am not sure how to do that in a straightforward way.

I plan to host my app with Firebase hosting, so if there's a solution for that platform, I'm happy to learn about it. But my question is aimed towards a general way of doing this.

1

There are 1 best solutions below

1
On

Firebase Hosting has additional features that let you customize how your content is hosted. You can set & customize to your own specific need at firebase.json file.

Here this link describes detailed information at hosting side how to define all, customized. Hope this page heps.