How do I persist custom subdomains in firebase hosting without redirects - subdomain

I've set up my custom domain with firebase hosting using their CNAME and A record details. Visiting http://sub.example.com redirects to https://example.com (not what I wanted)
I want to persist my subdomain (https://sub.example.com) in the address bar without the 301 redirect to (https://example.com) that I'm currently getting. Is this possible to set up this behavior within firebase hosting itself? I'd also like to point this sub domain to a certain html file/directory that I configure.

Related

Let netlify use a subdomain thats also used on a different site

(how) is this possible:
I have 2 netlify sites main-app and sub-app.
main-app has a custom domain (www.main.com).
I now want to make the 2nd site sub-app using the custom domain sub.main.com but Netlify forbids this and notes that I already use the respecity domain main.com.
Any help?
It is possible to use subdomains. It is discussed in detail in their docs: https://docs.netlify.com/domains-https/custom-domains/
You already have a Netlify subdomain where your app is hosted, of type myapp.netlify.app. Now you need to point your subdomain to this instance. If you use for example Namecheap, you do it like this: https://www.namecheap.com/support/knowledgebase/article.aspx/9776/2237/how-to-create-a-subdomain-for-my-domain/
Here is Netlify's instructions for doing this if you don't host your domain with them (aka not using Netlify DNS) https://docs.netlify.com/domains-https/custom-domains/configure-external-dns/
Similar DNS editing as in Namechrap will be seen on all other domain hosts. Once this is set up and has had time to propagate (give it 10 minutes to an hour) you proceed with hooking it up in Netlify. Your error message should now be gone.
Remember that you need different DNS records on your domain host for the main app and the sub app.
You can add a subdomain in the netlify panel and in you DNS manager / hosting provider add the records as CNAME with the domain provided by netlify.

How to setup https with a .dev domain on GCP

So I am currently trying to setup a static website by using Google Cloud Platforms and Google Domains. I have my domain already purchased and I added the following to my domains custom resource records.
www | CNAME | c.storage.googleapis.com.
I then created a bucket for my .dev domain. Then I added my html index file and some javascript files to that bucket. I made all of my files public and set the main page to my index.html file. After doing all of that I went back to my Google Domains overview and clicked website. This showed me a preview of my webpage loaded. I clicked it to go to my website but I am greeted with a privacy error.
NET::ERR_CERT_COMMON_NAME_INVALID
I am guessing that it is because my website is not using https. If I look in the advanced part of the error it says that my website is using HSTS. So my question is how do I change my website to use HTTPS instead of HSTS? Also, does this only happen to .dev domains?

How to link my Google Domain to a custom HTML webpage

My team and I have recently purchased a Google Domain, but when trying to have the website it is connected to, it only gives us the options of website builders. We have a GitHub repository with all of our files that we want it to host, but again, only website builders. Can I make my Google Domain connect to a custom HTML page?
You can host your content on GitHub and serve them with GitHub Pages
https://pages.github.com
You can have your Google Domains domain point to it.
https://help.github.com/articles/using-a-custom-domain-with-github-pages/
You'll need to add a CNAME file to your repo with your domain URL in it. Add it manually or follow the instructions here.
https://help.github.com/articles/adding-or-removing-a-custom-domain-for-your-github-pages-site/
You'll need to add some A records at the Google Domains control panel with the IP addresses of GitHub's servers (currently 192.30.252.153 and 192.30.252.154).
https://support.google.com/domains/answer/3290350?hl=en

'Cloaked' domain forwarding not working as expected

I've registered a domain with www.domain101.com. We'll call it www.example.com. I used their 'cloaked forwarding' option on my heroku app, which we'll call example.herokuapp.com. If I want to navigate to the posts index page, I would go to example.herokuapp.com/posts, of course; however, when I try this with my cloaked domain - www.example.com/posts - it takes me to the landing page. What's more, the url is constantly set to 'www.example.com' and the title of each page is "EXAMPLE.COM". I can click buttons on the pages and navigate through my website, but the url remains strictly at 'www.example.com'.
I used the forwarding option available on the website. What else should I be doing?
Domain cloaking uses a frame to make visitors' browsers show the cloaking domain in the location bar, while having the actual content hosted somewhere else. That's why the location bar never changes when you navigate around the site; and it isn't surprising that domain101's cloaking implementation doesn't forward path information to your Heroku app.
What you should do instead is configure a DNS server to direct traffic for your domain directly to Heroku. The simplest option for that on Heroku is the Zerigo DNS Add-on, which is free if you're hosting a single domain. You can also find DNS servers provided by lots of other people if you prefer.
Once you've configured a DNS server, you also need to tell your registrar that the DNS server you chose is the primary DNS for your domain. The way to do that varies between registrars, so you should check domain101's documentation for details.

How do I move a site from one url to another?

I have an ASP.NET web application hosted on DiscountASP.NET with its domain name registered on GoDaddy. This site is working perfectly and runs great, but I hate the domain name.
So now, I decide to purchase a domain name I like better. How do I set it up so that this domain name runs the same web app as my original application, but using the new domain name instead of the old one (i.e. I don't want to redirect to the old url, I want everything to work under the new url)?
This should be quite simple. Go to the host/registrar of your new domain and point it to the same ip addresses that the godaddy url points to.
You can have the old url and new url coexist. The DNS servers just map to the the physical IP your app is hosted on.
If you've been naughty and use absolute urls/directories in your app, you will have to rewrite some code. All the while reciting the mantra... that's why I should have used relative references...
Either move the application files over and create a redirect from the old URL to the new, or set up a rewrite under the new URL to transparently pass requests to the existing one.