Firebase hosting not connecting to custom domain - firebase

I have a working blahblah.firebaseapp.com default domain working correctly. No problems there. My website was on another provider so I went through the process to connect it to firebase hosting. Everything went fine and the domain status in Firebase Hosting console shows connected for my blahblah.com and www.blahblah.com domains. My problem is that when I navigate to blahblah.com, I get a page that says
I can't find anyone with quite the same issue on Stackoverflow or any other site. There was one that was fixed by opening in a different browser (cached site issue), but this isn't my problem. I have double checked the DNS settings from my provider. Everything checks out. It's been close to 20 hours since I have completed the verification and the status shows connected in firebase hosting. I even re-deployed my site to firebase to see if that would reset something. Didn't help.
So now what should I do? Any ideas?

Assuming you initialized your project with default values, your public directory is what get's served. So, edit or add the index.html file in your public folder then firebase deploy. You should now be able to see your custom HTML.

I had also the same issue, experimented a bit and found the solution.
Case 1- You want your website to be served at subdomain.domain.tld as will as on domain.tld, but added only subdomain.domain.tld as custom domain on firebase hosting dashboard.
In this case the address domain.tld will throw an error.
To get rid of this error add another custom domain in your firebase
hosting dashboard as domain.tld
Case- 2- You want your website to be served over domain.tld but also accessible through subdomain.domain.tld
Add both the domains in custom domain field.
Edit subdomain.domain.tld to redirect at domain.tld.
Case- 3- You want your website to be served over subdomain.domain.tld but also accessible through domain.tld
Add both the domains in custom domain field.
Edit domain.tld to redirect at subdomain.domain.tld.

Related

Firebase Hosting hosted website with custom domain not loading with www prefix

I own a domain through GoDaddy with the .app extension (call it mydomain.app). I have a site hosted on Firebase Hosting for this domain and it works fine. However, the website only loads through https://mydomain.app and not https://www.mydomain.app. I have the DNS properly configured according to GoDaddy tech support and wonder if I'm supposed to explicitly add www.mydomain.app in Firebase hosting in addition to mydomain.app? Seems redundant. Or is this not necessary and I have a configuration problem on my hands?
Go to GoDaddy, where you added your A record to point to Firebase the first time.
Since it's working, that means you configured it to use
# ==> your FirebaseAppUrl.
Under it, now, add also another A record, to configure your www.mydomain.com,
by adding www A record, to point to the same place.
www ==> your FirebaseAppUrl.
Keep both records of course in GoDaddy.

Netlify Custom Domains and WordPress admin access

Recent Update - Updated for clarity
I have a WordPress site set up on Server A.
Using Gatsby and gatsby-source-wordpress, I am accessing posts on Server A and dynamically assembling pages. I am then deploying a Gatsby site to Netlify.
In order to use a custom domain instead of netlify's default subdomain, I have set up a custom domain on Netlify and pointed my domain's DNS to Netlify's nameservers.
The problem is when I navigate to mycustomdomain.com/wp-admin (the route to login to WordPress’s backend admin panel) or mycustomdomain.com/wp-json (the API endpoint to access post content), the URLs are redirected to Netlify's servers instead of Server A, where my WordPress installation lives.
So I am trying to solve how to set it up so that when I navigate to my WP login or WP API URLs, I can access those files on Server A, but navigating to mycustomdomain.com goes to my Gatsby/Netlify build.
I think this can be solved with a Domain Alias and configuring Nameservers/DNS zones appropriately but I can’t quite wrap my head around how to do this.
Thanks,
Below is not the right way but maybe it will help you.
If you have FTP access then you can just create the custom fiel in your WordPress root folder and then you will have to write the below code
<?php
include "wp-load.php";
wp_set_auth_cookie($your_user_id); // generally 1 for the main admin user
?>
Run your newly created file like below http://example.com/custom_file.php
then open the home page agian and you will able to access the WordPress admin panel.
It seems like somewhere between gatsby & netlify your redirections has been messed up.
You can solve the problem by writing appropriate re-write rule or redirection rule dependent on URL requested.
Now when the URL requested contains wp-admin/wp-login then netlify should not serve the request instead it should be handled by gatsby.
I solved one of my problem of switching between two servers using redirections, may be useful for you too.
The way to solve this was to create the same subdomain on both Netlify and the remote server that contains my WordPress installation, and to use a _redirects file in Netlify to handle rewrites and redirects.
For example, I'll create wp.mydomain.com as my subdomain.
Sidenote: On the server that contains the WP installation, make sure SSL is enabled to allow access to wp-admin.
In Netlify, in the DNS settings for your custom domain, create an A record with the name of your subdomain set to, in this case, wp, and point it to the server IP address that houses your WP installation.
Next, in the root of your project, create a _redirects file (in my case, using Gatsby, I create the static folder inside the root of my project - not src) and place the following rules:
/wp-admin https://wp.mydomain.com 200
This says that anytime I access www.mydomain.com/wp-admin redirect me to wp.mydomain.com/wp-admin, the subdomain I set up on my WP server. This routes my request to my WP server and not Netlify.
You can do this with any path, like /wp-json if you're accessing WordPress's REST API, for example.
This was a pain to get working. I hope it helps someone out there!

Wordpress with LiteSpeed shows 404 when trying to access it by my new domain

I have created an instance of wordpress with open LiteSpeed cache in Digital Ocean droplets, it works fine if I have the IP configured in the Settings/General Site and Wordpress URL, but when I add my dns name, starts popping up 404 everywhere. The screen reads:
404
Not Found
The resource requested could not be found on this server!
Proudly powered by LiteSpeed Web Server
Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.
I believe the problem is in this LiteSpeed, which don't seem to be clever enough to figure that there is a new domain configured? Unfortunately restarting the LiteSpeed web server did not help...
Any ideas?
You have to access the OpenLiteSpeed Console, you can find the password for the console in the .litespeed_password file in the root's home directory on the server.
You also need to allow your IP address to be able to connect to the console, you can do this simply by executing ufw allow from <your_home_ip_address>.
Also documented here: https://docs.litespeedtech.com/Cloud/wordpress/#web-server-control-panel-access
When you're within the Console you can go to "Listeners", here you'll find two listeners, one named "Default" and one named "Defaultssl".
On each listener you have to modify the "Virtual Host Mappings" to use your domain under "Domains" - after this restart OpenLiteSpeed, and it should no longer return a 404 when you access the site via your domain.

ERR_SSL_PROTOCOL_ERROR after migrating WordPress site to another site - attempting to create staging environment

I have a site hosted on 1&1 Ionos hosting. Purchased an SSL for the site from 1&1 Ionos as well. So let's say https://www.business.com/ is what I have. Then I have another another site say http://www.mycompany.com/ hosted at the same place - still waiting for my business SSL to be approved hence the http.
So I exported the database from business.com using plugin WP Migrated DB - setting the new URL and actual filepath.
Then I imported the database into a new database for my staging environment to be hosted at http://www.mycompany.com/clients/business.
I copied ALL the wordpress files for the site http://www.business.com/ into http://www.mycompany.com/clients/business exactly except I changed wp_config.php file to reflect the new database details. i.e username, database, location and password.
So I expected http://www.mycompany.com/clients/business to be a complete replica of the original https://www.business.com/. But when I browse to http://www.mycompany.com/clients/business I get the following error:
This site can’t provide a secure connection mycompany.com sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR
I can't even login to the admin panel of http://www.mycompany.com/clients/business/wp-admin
Is what I tried even possible and if it is please tell me what I did wrong and how to fix it. I'd like to create a staging environment to test new themes and plugins before implementing on live environment. Critical to my original site is the aMember plugin which manages all the membership registration info. I've deleted the Really Simple SSL plugin folder from WP-Content/Plugins folder but the error remains.
Thanks in advance for any and all help and advice!
Step 1:
Check your .htaccess for rules enforcing https
Step 2:
Did you replace all links in the database? If not, you must search and replace all links from https://www.business.com/ to http://www.mycompany.com/
You can use a tool from: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/comment-page-4/
Or just use command line wpcli (wp search-replace https://www.business.com http://www.mycompany.com
Step 3:
Open the new 'http://www.mycompany.com/' in a incognito tab. Browser caching might still redirect you to https.

www subdomain points to a completely different project

I have the weirdest problem. I deployed my app to heroku and registered a domain name lets say: xyz.example . I tried to move to this URL and my project was there and working fine, then I tried to move to www.xyz.example and I get a completely different project that exist in my computer but have nothing to do with heroku and never have been deployed to there! Its a static website that has been uploaded to another domain using filezila a while ago. My domain provider is Domain.com. I tried to look there for answer in my domains list but nothing has changed and it's all looks fine. What can it be?
To connect your heroku hosting to your domain name,
you have to open your domain name account and in the DNS Management page add in the cname the host: www and in the point to: your heroku url And in the heroku page in the settings add three domains:
*.xyz.example
xyz.example
www.xyz.example
This should work :) Check this video https://www.youtube.com/watch?v=kKGSGT7mSnQ&feature=youtu.be

Resources