Why SvelteKit route slugs are indexed by the Google Search Console? - server-side-rendering

I have a full-stack SvelteKit application that uses SSR (no prerendering), and the Google Search Console indexes not only my resolved routes, but also the unresolved routes with slugs, like this:
How is it possible?

Two potential explanations
You are running a static hosting website and these are folders on the file system. Directory listing is then exposed by your web server and Google indexes this.
You are running some code to generate sitemap.xml or use a third party service for this. Then this code is buggy.

Related

How hosting a web application streamlit in Google search queries?

I have a streamlit web application. It is hosted on a vps server, combined and configured with nginx. Additionally, I received and configured access by domain name, received a ssl certificate.
I would like to place this application in Google search engines. So that when you enter a domain name into Google, it appears in the search results. I looked at the google documentation on how to do this. Actually there are two ways:
Creation of a special html page in the root directory
Adding a meta line on the main page of the application.
It seems to be nothing complicated, but how can this be done if I use streamlit as the basis of the web application? Can you give an example of what needs to be done to confirm the right to host the site?

nextJS api routes not working with Firebase Hosting

I am having an issue with using Next.js API routes when deploying my website to Firebase Hosting. Here is the api call:
And here is the set up in the pages directory:
Here is the function used in email.js:
I changed the variables as to not give away my email address.
The call works when I use local host. However, when I build and deploy to firebase. I have tried to use the firebase url to make the api call, but I get a 404 page not found. I am not sure how to fix this. I would really appreciate any help.
Firebase hosting only hosts static files which is why your api routes don't work there. If you had a fully static Next site, you could host it on Firebase hosting. But if you want to use the api routes in Next, you need a server. One way to do this (albeit complicated) is to set up Firebase Functions with your api code and then rewrite requests in Firebase Hosting to that Firebase Function. It's complicated because it would require a fairly complex deploy process.
If the rest of your site is static, you can use Firebase Hosting for that and then consider ditching the api routes and instead setting up a Firebase Function to act as your api completely separate from Next.
Or if you want to keep it all in Next, consider something like Vercel for your site + api via Next.

Deploy website on Firebase Hosting with specific path

I have my own domain i.e www.example.com, and I just connected with Firebase Hosting, however what I want is to deploy a website (using Flutter) for that domain and a different one with the following path: www.example.com/other, as you can see the /other should direct to another website that I have, is that possible throw Firebase Hosting? or do I need to have two domains one for each website
Firebase Hosting only deploys a single site in its entirety, using all of the content in a single folder, usually called "public" in your project. It doesn't really do partial updates scoped to a specific path.
You can certainly deploy multiple apps to one site. You will just have to make sure all of their content is added to that public folder for deployment as a unit. If you don't want to do that, you can certainly manage each site independently with a different hostname for each.

How to put a FIREBASE HOSTING site into maintenance mode?

I have a Vue.js app and use Firebase Hosting to serve the static files to users.
Does Firebase Hosting have a method for putting the app into maintenance mode remotely? Without having to do firebase deploy
Maybe something that will allow me to redirect all the traffic to some other index.html, and be able to manage it from Firebase.
P.S. I've already looked into Firebase Remote Config (and it doesn't fit my use case, and their web related tools aren't fully implemented yet). And I'd like to avoid having a realtime database just for maintenance mode.
There is no mode-switch built into Firebase Hosting for temporarily serving other content.
But given the recent updates to deploy efficiency, it should be pretty low-cost to put up a temporary index.html while making the changes. Alternatively, you could deploy rules (in firebase.json) that temporarily redirect all traffic to a wip.html (for work-in-progress).
Which of these works best, depends on your current content structure. I.e. if you already redirect "all" traffic to index.html, I'd probably go with a rewriting solution.
You can also unroll your last deploy in one command.
Deploy maintenance page
Unroll when its done
Don't forget to send a 503 error for googlebot, asking it to come back in X hours.

Firebase function on custom domain without hosting

So I just wanted to host my Firebase Functions on my custom domain without hosting anything. I host my website somewhere else already.
Unfortunately, Firebase throws errors when trying to deploy functions with rewrites BUT without the public directory OR when the public directory is empty.
How can I do that on Firebase without a hack and hosting some redundant stuff? I just want to host the functions on a custom domain.
It seems that Firebase Hosting requires at least one html page, even if your only hosting functions. Just add a blank index.html to a directory and point hosting to that.

Resources