Subdomains with CloudFlare - hosting

I'm using CloudFlare in my website and it works perfectly. Problem is, I decided to host my static files like JavaScript, CSS, etc. in static.example.com and I don't know how to set up the subdomain.
I already tried adding a CNAME record (static is an alias of example.com) and it didn't work, and as a A record (static points to IPAddress) where IPAddress is the IP address that both www and example.com use.
I'm I doing something wrong? I've waited about an hour for any DNS propagation problems and still doesn't work.

If you have added the subdomain in your CloudFlare DNS settings (settings->DNS settings), then it should start propagating out after a few minutes or so. If you're still having issues with the subdomain, please contact CloudFlare with the domain name so we can look at it.

I had the same issue until I realized I had to click on the greyed out cloud on that row to activate Cloudflare on the subdomain. This is what it currently looks like:
The instructions at the top of the page clearly say you have to do this, but I'm not one of those read the manual types for simple tasks. I guess what would have really got the point across was some sort of notice the very first time I added a subdomain on my account.
Once you've clicked the icon, then the activated proxy will be indicated like this:
Oh well, hope this helps somebody else.

Related

Using one Laravel app from different domains - building urls issue

I searched for my issue in so many ways, but I don't seem to find the correct case, so I'm asking here.
I have a Laravel app which is installed on a server and everything works correct. The domain is set as HTTP only and is configured from AWS. However we need to have another domain which should work only from HTTPS. The HTTP domain is pointing to the server instance and the HTTPS one is pointing to a CloudFront distribution with origin the HTTP domain. The issue is that when I open the HTTPS domain, all of the links and images are loaded from the HTTP domain.
To be more concrete, let's say I have http://mysite-notsecure.example.com and https://mysite-secure.example.com.
When I open http://mysite-notsecure.example.com everything works as it should and there are no issues. However when I open https://mysite-secure.example.com the site loads, also files like app.js and app.css load with the correct host, but things like fonts, images, links, etc, load from http://mysite-notsecure.example.com.
Because most of the urls are built with the url() function, I think the issue has something to do with APP_URL, which was first set to http://mysite-notsecure.example.com, but when I added the new domain, I set it to empty (APP_URL=),
however the urls are still built the same way (I cleared config cache).
What should I do in order for my site to build the urls according to the current host?
I don't need any other change for the two domains. They should load everything exactly the same, only the host should remain and not redirect to the other domain.
It turned out there were two different issues.
I'll describe them here, because there is a slight chance someone could be dealing with one of them.
First, I printed the contents of the $_SERVER variable on both domains and the host in both was the same - the HTTP domain.
This issue was from the CloudFront configuration. Turned out the Host header was removed from the CF distribution behavior, so that CF replaced it with the origin's value (the origin is the http domain). After this was fixed, the host in $_SERVER appeared correctly.
But the initial issue for the urls building was something else which I didn't think of. After clearing the cache to remove the debugging and seeing the right urls on the HTTPS domain, I switched back to the HTTP one and saw now there all the urls pointed to the HTTPS domain. That is when it hit me that these domains share not only the configuration, but also the cache. And most of my urls on the page I was testing with, were coming from a function with cache, so when the cache was stored from one of the domains, they appeared the same on the other. When I included the host in the cache key, everything worked correctly.
Hope this helps someone else.
goto file .env and setup the APP_URL=https://mysite-secure.example.com/ and change
href={{asset('folder-path')}} in layout or blades file

Setting up a GoDaddy domain name with Heroku

I'm new to using Heroku so I'm a bit confused because I initially had my website hosted on GoDaddy, but when I added node to my web app I switched to Heroku.
So what is happening is when I visit my website using www. it goes to the correct, updated site, however, when I try the naked route it takes it to the older version of the website. I figured since it's still showing the older site with the naked route that there was a problem on GoDaddy, therefore, I updated one page on GoDaddy and sure enough, the page is updated via the naked route now.
That leads to my first question. If my website is now on Heroku, does it still need to be hosted on GoDaddy as well? Additionally, if the first question is yes, then how do I set up the naked route to point to the same site as the www. route?
I've already have the host as www with the 'points to' pointing to the Heroku domain name but still getting the problem above. This is why I believe the problem lies with the hosting on GoDaddy.
You don't need to host a copy of your site at Goddady.
In Godaddy, you must have a CNAME www pointing to heroku:
your_application_name.herokuapp.com
or
www.your_application_name.com.herokudns.com.
To use heroku for your naked domain, you can define a redirection for the naked domain to your www:
Go to My domains (https://dcc.godaddy.com/manage/)
Click on Manage connection
Set forwarding option (choose www.your_application_name.com, forward type permanent)
This is what helped me as of 2019. First, get to the list of your domain(s) on GoDaddy's interface. You'll see something like this:
GoDaddy's all domains page
Choose your domain. Once you're on your domain's settings, scroll to the bottom and click on 'Manage DNS'. You should see some records created, if there are any.
ACTUAL CONFIGURATION
FIRST STEP:
Create a CNAME record(there should be an 'add' button somewhere). The record should have the following parameters - Type - CNAME, Host - www, Points to - enter the link heroku created for your app.
creating a CNAME record on GoDaddy's
Sometimes when there are other old CNAME records, it'll throw an error. Erase old CNAME records and try again.
SECOND step:
Go to your terminal and enter the command 'host www.yourdomain.com'. If the CNAME record was successful, you should see the heroku domain you enter earlier. IMPORTANT - You should also see a bunch IP addresses which we will need.
THIRD step:
Create 'A' records for all the IP addresses provided on the 'host www.yourdomain.com' terminal command. They should have the following parameters: Type - A, Host - #, Points to - IP address, choose TTL custom and type 600 seconds.
This should do it

How to view my static website without storage.googleapis.com in the address

I am trying to build my first website on a domain that I purchased through Google Domains. I have followed this tutorial but am still unable to reach my site by visiting www.mysite.com
I have ensured that index.html and 404.html are set to public-read and I can see them by clicking on the public link button in the console, but that takes me to https://storage.googleapis.com/www.mysite.com/index.html
I want to simply be able to type www.mysite.com and see my index.html document.
I have added a record set with DNS Name www.mysite.com and Data c.storage.googleapis.com but still have no luck.
What am I missing?
UPDATE
This tool shared by a commenter below shed a bit more light on what seems to be causing the issue. It looks like my registrar setup is not finished, but I am not sure how to do so.
I noticed that when I search for www.mysite.com, every field says No record found, but when I search for just mysite.com (no "www"), some fields are populated (not AAAA, CNAME, A, SPF, SRV, TXT, SRV, or LOC, though)
I also noticed the "Registrar Setup" link on the Cloud DNS page, which says "This zone will not normally be usable until you register the related domain and configure these records with your registrar:" and lists ns-cloud-e1.googledomains.com for e1 through e4.
Why are fewer fields populated for www.mysite.com than for mysite.com, and what steps do I need to take to finish my registrar setup?
UPDATE: ANSWERED
I determined the issue and have posted the answer below
What error do you get exactly when you go to www.mysite.com? Does it resolve? Do you get a 404? Do you get the 404 you specified? Or a 404 from Google? Or something else?
Are you sure the CNAME is set correctly? You can check it with a tool like this:
https://www.ultratools.com/tools/dnsLookup
What happens when you go to www.mysite.com/index.html ? Did you assign pages?
https://cloud.google.com/storage/docs/hosting-static-website#optional_assigning_pages
I found the issue: I had added my CNAME entry on the Cloud Console > Cloud DNS page, rather than on my Google Domains registry. After removing the entry from the Cloud DNS page and adding it to the Google Domains Configure DNS page, my site is up and running.

Wordpress Issues Regarding IP and Domain Name - Host Gator

I am hoping somebody can help me because I am on the verge of frustration tears.
The company I work for has a site hosted on godaddy and has to remain up until I complete the rebuild on hostgator, using the Wordpress theme, Grand Restaurant http://themes.themegoods2.com/?theme=GrandRestaurant
To get around the domain name issue since I cannot change nameservers yet, I had to use the Google Chrome plugin, Virtual Hosts, which has me input the IP and domain, to force access to the site.
Everything was working fine until I needed to use the "content builder." If you look at the Grand Restaurant theme, you can click on Menu. I need to use the "Menu Grid" option in the content builder but it does not work. Whenever I try to add the menu grid, it appears that it is trying to load (showing the gif loading image) yet in never actually loads. I have spent several days and hours going back and forth with host gator and the theme developer.
The theme developer says that the content builder does not work because:
"The WordPress URL and Site URL are set to the domain name. When you are logged in, you are being redirected to the IP, so the browser sees 2 different sites and some functionality ex. AJAX call doesn't allow you to get data from different URLs.
Your WordPress URL and Site URL settings are different from your actual site. You have to change your Domain Name URL and Site URL settings to the IP number."
I did what he said earlier today and it completely broke the site. Spent nearly 2 hours with host gator's tech support to get it back up. All tech support will tell me in regards to the content builder not working is that I need to change the AJAX file to allow the site URL and wordpress URL to be different. I have no idea how to do that!
Any wisdom you all could provide would be greatly appreciated. I have 1700 bakery items that I need upload by the end of July and I do not know what I am going to do if I cannot get the content builder working.
In order for this to work properly you should be using a method of back up and restore. By migrating from one hosting provider to another you could simply deploy the new Wordpress on host gator as a new site and import the Wordpress backup to the host gator with the many different plugins available through Wordpress. The way your trying to complete this is impossible and usually will only work with images and back ups being managed on virtual machines, and VPS. It won't hurt anything on the original up and running site. You mentioned that host gator was able to get the site back up? You shouldn't have to rebuild this if you use a back up and restore method. Everything should fall right into place, you can also test these methods through virtual box, and VMware virtualization products which offer trial versions. Try using a migration method and see if the conflicts still persist with the content builder.
Heres is what I would do if you cannot change the domain over but still use the domain for the dev environment.
Modify your hosts file and use hostgators IP and the company domain as the entry.
Install wordpress to the current company domain by simply entering the domain (Should go to hostgators server since you've added that entry in your hosts file)
With the hosts file modification, you should be able to view the wordpress site thats hosted with hostgator using the live domain name.
This way, when you're launching, theres no need to do any modification on wordpress. Simply change the DNS over, revert your hosts file and the site will swap over seamlessly.

Tumblr - Custom Domain Help

I own the domain name, iamgabeaudick.com. It was my personal website, but I now want to use it as my tumblr domain. I've changed the DNS, and tumblr confirms that the domain is set up correctly.
But when I access iamgabeaudick.com, a blank "Index of /" page appears.
Any ideas why this is? Do I need to configure the ftp files in some way?
Your domain is working fine for me (I can see your Tumblr blog). It sounds like your DNS is just being cached, either by your computer, or by your ISP.
You probably just need to wait 24hrs.
DNS settings take some time to propagate and not all DNS servers refresh at the same time. Like #webdestroya says, probably give it a day. For what it's worth it hasn't updated for me and I'm seeing the "Index of /" at the time of this post, but since it worked for someone else it probably just needs some time.

Resources