0

I am setting up my first website and currently am confused when it comes to properly configuring the subdomains.

I have got a domain from GoDaddy which is, let's say website.com. Then, I am using Firebase for my hosting, database and so on. I managed to register my domain for the Firebase hosting service and that works just fine and I am able to access it properly.

Then I wanted to add two new subdomains which are sub1.website.com and sub2.website.com. First, I went to Firebase console and added those two new subdomains. Then I registered those A (or whatever was the name) entries on my GoDaddy console as requested by Firebase.

After that, I created two subfolders - sub1 and sub2 - in my public directory for my project, added different index.html files in each and deployed hosting to Firebase. Then I was able to access my subdomains at website.com/sub1 and website.com/sub2, but when I went to either sub1.website.com or sub2.website.com, it redirected me to the main page - website.com.

I want to know what I am doing wrong. I searched for answers here on SO and Google, but was not able to find the proper fix just yet. Please help me to resolve this silly issue.

P.S. I am using AngularJS for web development, if that changes anything.

ossmalpha
  • 881
  • 6
  • 10
  • Firebase Hosting does not map subfolders to subdomains. All domains tied to a single project will serve the same content. To serve different content for each subdomain, you'll need to create a separate project for each subdomain. See https://stackoverflow.com/questions/44047865/firebase-hosting-serve-different-pages-from-different-custom-domains – Frank van Puffelen Jan 26 '18 at 14:51
  • Thank you for your answer. Unfortunately I was not able to find the previous answer (that you posted), but now I know. :) – ossmalpha Jan 27 '18 at 12:22

0 Answers0