Customizing hosting behavior
Firebase hosting offers a number of customizations, including rewrites, error pages, redirects, and headers. These customizations help with how your web application is behaving at any given point. Let's explore the most important features.
Custom 404/Not Found page
As developers, we need to realise the user is not going to be tech savvy; he will run into some error scenarios, and identifying them before that happens is very helpful. If the user tries a different URL than the suggested URL, we should show an error page. The process of adding the error page is straightforward; it's just a 404.html
page inside your public
directory and Firebase will show the page if the user tries a different URL.
Redirects
URL redirects help to avoid broken link situations and are also used for URL shortening. When a browser tries to open the shortened URL, or a URL that has moved to another destination, using redirects we can still reach the expected page. Fundamentally, redirects...