Firebase Hosting. Firebase Deploy only deploys index.html - firebase

I have a small website with 3 different html pages. I am trying to host with firebase. When I run firebase deploy in the target directory, the only page that gets hosted is index.html. If I click a link on the website to navigate to one of the other pages, I am navigated to a 404 page.
All pages are located within my public directory.
Here is my firebase.json:
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
How do I get firebase to host the other html pages?
Thanks in advance for your help!

Firebase hosting uses case-sensitive URLs.

Related

Deploy a nextjs app to vercel and point subdomain from cloudflare

I need to deploy a nextjs app to vercel and I am using cloudflare to manage the dns. I need to point dev.domain.com to vercel deployment. In vercel Project Settings-> Domains I have added the sub domain.
In cloudflare I have added the records as type: cname . name: dev content: cname.vercel-dns.com . In vercel it is showing valid configuration. When I tried to access the subdomain it says site cant be reached with error code as DNS_PROBE_FINISHED_NXDOMAIN
you need to add A record for your subdomain pointing to vercel ip.
Type: A
Name: dev
Content: vercel ip
make sure to switch off proxy status until vercel verifies your site

Vercel custom domain returning: Not Found - Request ID:

TL;DR: I have a next js website that is working on all vercel domains (production, and preview domains). When I try to use a custom domain they return a page that looks like the screenshot below:
Vercel domain: https://tasmto.vercel.app/
Custom domain: http://www.tasmto.com/
GH repo: https://github.com/tasmto/portfolio/
The site is in a subfolder named web but I have already configured that on vercel and I've made sure Next.js is the selected framework.
What I've tried so far:
Pointing the domain through an A-record and using nameservers.
Deleting the entire vercel project and trying again.
Pointing a subdomain to the app instead off myt apex domain.
Redeploying the app.
The site works when I use 100% Netlify but for some reason Vercel just doesn't want to serve an already working site to my domain and I am stump'd.
Thank you so much in advance (any advice or ideas will help).
PS: I know variations of this questions have been asked but either I'm too dense to apply the solutions or I've misconfigured something else somewhere.
Ok, after sleeping on it here is what finally worked for me.
(Optional) I added a now.json with the contents below.
Because I was using the nameserver option I went into the domain settings inside of vercel and added the pre-existing A record again (as if I wasn't using the nameservers at all.
Now.json contents:
{
"name": "portfolio",
"alias": [
"tasmto.com",
"www.tasmto.com"
]
}
If this doesn't fix it have a look at this stackoverflow question.

Is it possible to use Vercel (Next.js) + WordPress on other webserver using reverse proxy to mask URL?

I'm trying to build my app using next.js, deploy on Vercel (mydomain.com) and have a path called "/blog" that would pull my blog.mydomain.com under mydomain.com/blog.
I was able to do it changing the WP site URL, but only the home will be available, so if I try to access, for exemple, mydomain.com/blog it's OK, but if I go one path down It will redirect to the original blog domain.
mydomain.com/blog -> OK, the URL is masked and it will show my WP under vercel domain.
mydomain.com/blog/hello-world -> redirects to blog.mydomain.com/hello-world
I've read a lot of documentation on vercel/next.js, I've also tried using reverse proxy, but my lack of experience with webservers made it very hard to achieve the expected result.
I've found many answers, but none of them could apply to Vercel + External WP, so I hope you could bring some light so I can see what am I missing...
Thanks!
I had similar issue with wordpress blog under blog.example.com. It turns out the blog was adding / at the end of the nested routes. I solved it with following code in the vercel.json:
"rewrites": [
{
"source": "/blog",
"destination": "https://blog.example.com"
},{
"source": "/blog/:match*",
"destination": "https://blog.example.com/:match*/"
}
],

How configure different subdomains on firebase hosting for to serve different content by each subdomain?

Can i create different subdomains from Google Domains, register them on Firebase Hosting and serve different content by from each one subdomains?
If the answer is yes, how?
I followed this guide: https://medium.com/#fransandi/use-firebase-multisite-hosting-to-associate-multiple-domains-subdomains-to-your-project-ee099109bfe9 and although its title says "multiple domains/subdomains", it didn't help me for deployed content on my subdomains. Always got this error: "Error: HTTP Error: 404, Requested entity was not found" when run "firebase deploy --only hosting:my-target".
Deploy in my main domain easy, but for subdomains... I can't.
Create a separate folder for each site/app, and then deploy hosting for each site/app. When you click the "add custom domain" button, type in the subdomain that you want to use. Example
mysubdomain.mydomain.com
When you add the 2 A records to your domain registrar make the host name your subdomain instead of # or www.

Firebase Dynamic Links with Subdomain

I have successfully configured Firebase Dynamic Links with my own domain at a link like this:
https://example.com/links/
On example.com I can serve my site (through Firebase Hosting) without any problems, and on example.com/links I have my dynamic links. Everything went smoothly there, I had to add this to my firebase.js:
"rewrites": [
{
"source": "/links/**",
"dynamicLinks": true
}
]
What I want to do now, is have the same thing but on links.example.com subdomain in place of the /links path. This should be possible according to Firebase's docs, but when I try to create the URL prefix in the Console it asks me to add this to my firebase.js:
"rewrites": [
{
"source": "/**",
"dynamicLinks": true
}
]
I tried that, and the Dynamic Links do work, but my whole site is treated as a dynamic link now, even when using example.com without the links. subdomain.
Am I missing something here? Something I can add to the firebase.js or configure in the Console to only treat the subdomain as a Dynamic Link?
You would want to create an additional Hosting site in your project for the subdomain rather than add an additional subdomain to your existing site. On that site, you could deploy just the dynamic links config without any additional files.
There is no way to configure a single Firebase Hosting site to serve different content based on the domain.

Resources