Firebase Hosting Redirect and Rewrite Rules
📖 Scenario: You are setting up a website using Firebase Hosting. You want to manage how users are sent to different pages and how URLs are handled behind the scenes.
🎯 Goal: Build a Firebase Hosting configuration file that includes redirect rules to send users from old URLs to new ones, and rewrite rules to serve specific content for certain URL patterns.
📋 What You'll Learn
Create a
firebase.json file with hosting configurationAdd a redirect rule from
/old-page to /new-page with a 301 statusAdd a rewrite rule to serve
/app/** URLs with /app/index.htmlEnsure the configuration is valid and deployable
💡 Why This Matters
🌍 Real World
Redirects and rewrites help manage website URLs smoothly, improving user experience and SEO.
💼 Career
Understanding Firebase Hosting rules is useful for web developers and cloud engineers managing static websites and single-page applications.
Progress0 / 4 steps