Naked Root Domain Hosting - redirect

The usual approach calls for pointing mysite.com to www.mysite.com.
But suppose that I would like not to redirect. In other words, I would like to set up a naked root domain, without setting up any sub-domains, not even www.mysite.com.
I am using Route53 and S3. Presumably I would need just one hosted zone (mysite.com). Do I still need two buckets (mysite.com and www.mysite.com) or can I set up just mysite.com?

Set up the bucket, named for your domain name. The bucket name has to match exactly the address that shows in the browser's address bar.
Then, create an A record at the root (apex) of the domain in Route 53, leaving the hostname empty, selecting "Yes" for Alias, then select the bucket in the drop down list.
That is all you have to do.
If you create a "www" CNAME pointing to the domain name itself, this will not work with S3 web site hosting, because the bucket name won't match what's in the address bar of the browser (and a CNAME does not cause the browser to change the address bar to the target).
Everything in DNS that points to S3 must have a corresponding bucket that matches the DNS entry. That's how it was designed.
Because people are often very prone to typing "www" in front of web site hostnames, you probably should create a second bucket with "www."+your domain name as the bucket name, then configure that bucket to redirect all requests to the root domain name, and set an additional Alias record on S3 -- because that way if a user types "www.example.com" into their browser, it will hit the second bucket and redirect -- by changing the browser's address bar -- to the root domain... which almost certainly is what you actually want, from a usability perspective.

Edit after some testing on one of my extra domains. The information
posted below is incorrect. I'll leave this here so others don't follow down this incorrect path.
--------------------------------
That's what CNAME records do for you. Just add a CNAME for 'www' that goes to yourdomain.com
Both www.yourdomain.com and yourdomain.com will work in the browser without any redirection.
in Route53 it will look like this.

Related

How can I show subdomain data in GA4?

I am attempting to view subdomain data in GA4. My client has a main site, with several additional subdomains all using the same gtag.js tag (I confirmed that they are all using the same gtag). When I view data in Google Analytics, I'm not seeing the subdomain URLs.
I have attempted the following to access the data:
I set up the primary domain as an "Unwanted Referral", though I was not seeing the subdomains listed when viewing Reports > Acquisition > Traffic Acquisition > Type Referral in the local search > Switch Session Default Channel Group to Session source/medium).
I set up a segment: (Sessions > Hostname > subdomain url) but am not seeing the subdomains listed in the auto-populate dropdown. When I enter the subdomain manually, no data is shown.
The subdomains are showing as indexed in Google Search Console.
I confirmed that the site is using the correct configuration of Google's Global Site Tag (gtag.js). Specifically, the default setting of the cookie domain parameter is set to 'auto'.
I would expect to see subdomain data in Google Analytics, but am not getting anything. Would it be better to set unique accounts for each subdomain?
Cookie domain shouldn't matter here. GSC most definitely does not matter. Referral traffic shouldn't matter either. The start of your debugging should really be looking at all the distinct values of the hostname dimension.
If you don't see your hostname there, then the next step is verifying proper tracking on the missing hostname. Go there, pay attention to the tid value in the network request to google's collect endpoint. The tid should be exactly the same as the tid of the main site, unless you're using a different source for the subdomain, but it's unlikely.
Wrong tid is the most probable issue. If it's exactly the same, then check the dl field in the network request. Make sure it contains correct subdomain.
The next step I would take is checking the Filters of the property you're looking at. Make sure you're not filtering your traffic out.
If these don't help and you still have the issue, make the screenshot of your explorer where you pull out the hostname dimension by hit and show the screenshot of the ga4 event that you believe should be displayed there.

How to configure DNS record on Google Cloud

I have a domain with Google, and I want to configure DNS on Google Cloud to use "www.example.com", and not "sites.google.com/...."
The typical solution here is to use any of the following:
CNAME record that points domainname.com to domainname.provider.com
A record that points domainname.com to the same IP address that domainname.provider.com
This should work for several different providers. But many providers use 'virtual hosting' which means that a single server, identified by an IP address, will be serving different websites, and will use the domain name as sent by an HTTP header. You need to tell the provider, sites.google.com, that domainname.com is a valid name for the server as well.
You could configure a CNAME Record, this is used in the DNS to create an alias from one domain name to another domain name:
Example:
www.yourdomain.com CNAME yourdomain.com
You could need also an A Record to point your Ip address at your domain. The A record translate the human readable domain name to an IP address.
Example:
yourdomain.com. A192.162.101.100 .
If you already has the CNAME Record you can go to the Google cloud console and select the Cloud DNS page, once there you can follow the next steps:
Click the zone for which you want to create a resource record set.
On the Zone details page, click Add record set.
Enter the DNS name for the record set—for example, test.example.com.
Select the resource record type. (here you can chose the CNAME record)
Enter the time to live (TTL) for the resource record set—for example, 30
Select the TTL unit—for example, minutes.
Enter the details based on the record type that you have selected.
Click Create.
In the next link you can find more information related to manage record

How do I set up a domain name to redirect to another URL and then check referrers from that domain?

I'm running a print campaign and have bought a specific URL to try and measure the efficacy of that advert.
I'm using cPanel and Google Analytics.
I want people to type in the new, advert specific URL and be redirected to my actual, live domain name and I would like it to show up in Google analytics as a referrer so I can track how many people visit that website address.
I haven't a single idea how to do this properly. i've set it up as an addon domain in cPanel, and have also set it to redirect to my main URL from within cPanel, but at first glance in "real time" and "traffic sources" it just says "direct", but I want it to show this URL.
So to sum up, I want people to type in a URL, it then redirect and for it to show up in analytics as a referrer, by name. Thanks in advance!
I've done it, and here's how I did it:
I set the domain name up as an addon domain on my cpanel account.
Then I created a .htaccess in the root of that subdomain, with the following content:
# Permanent URL redirect
Redirect 301 / http://www.DomainName.co/?utm_source=Domain-Name.co.uk&utm_medium=mediumName&utm_content

Heroku/GoDaddy: send naked domain to www [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am trying to figure out how to get the naked domain for my website to redirect to the www domain. I am using Heroku and have the domain from GoDaddy. Because of Heroku, my A records are already set up as:
#: 75.101.145.87
#: 75.101.163.44
#: 174.129.25.170
And my www CNAME points to proxy.heroku.com.
I've been looking all over the internet, but can't find a simple, free answer for how I can do this redirect. Some answers discuss using paid services, which I don't want to do, and others talk about going in and modifying Heroku settings, but then don't really give much explanation. Right now, if you go to my naked domain, it's just Heroku saying that no such app exists, while if you go to my www domain it's my app.
On GoDaddy, use the "Forwarding" feature to setup a forward from yourdomain.example to www.yourdomain.example. The forwarding feature can be accessed in the Domain Manager at the bottom of the "Domain Information" section:
If you do this then all traffic to yourdomain.example will be routed to the Heroku app CNAME (which is the better approach).
One note, however, if you are on the Cedar stack then don't use proxy.heroku.com for the host of your www CNAME. Instead use your-app-name.herokuapp.com. These details are covered here.
GoDaddy also specifies that in order for your domain name to forward, its A record must be pointed to 64.202.189.170 or must fall between the following ranges: 50.63.202.1 - 50.63.202.31 or 184.168.221.1 - 184.168.221.31.
You could also use http://wwwizer.com to forward from your naked domain to your www. In GoDaddy in the DNS manager under the A record in the # heading type in 174.129.25.170. They will automatically redirect from the naked domain to one with www. in front of it.
In GoDaddy's DNS Zone Editor, you will want to configure your CNAME record www to point to #. In your A Record, you'll use a wildcard (*) to point to the IP address and a second A Record that uses # as the host that will also point to the web address. This way,
subdomain1.example.com will forward to your IP
www.example.com will forward to your IP
silly.example.com will forward to your IP
anything.example.com will forward to your IP
Frequently Asked Questions
Can I point *.mydomain.example to my Heroku app?
Yes, using the free Custom Domains feature of Heroku you can point a wildcard domain to your application.
What IP addresses should I use to point my custom domain to Heroku?
The Heroku routing stack uses a collection of IP addresses that can
change at any time, and using A records to point to your app is not
supported. To ensure your domain always points correctly to the
routing mesh, configure subdomains (e.g. www in www.example.org) using
a CNAME record:
If the app is on… Then CNAME the subdomain to
Bamboo yourapp.heroku.com
Cedar yourapp.herokuapp.com
Naked (or bare/apex) domains (e.g. example.org) should be avoided
because of their availability and uptime consequences.
Why can't I add subdomain.mydomain.example for my app?
In some cases, attempts to add a custom domain (like
subdomain.mydomain.example) for an app may result in an error like this:
! mydomain.example is owned by another user
All applications for a given base domain must be owned by the same
Heroku account. The above error means that someone else has already
added a mydomain.example custom domain to one of their apps.
If you have the IP addresses setup on your naked domain and your www cname'd to yourappname.herokuapp.com then all you need do is use something like RackRewrite in your application to redirect the requests when they arrive at your application.
What you want to setup is any request to the naked domain gets redirected to your www address. After following the installation instructions add an initializer in config/initializers
ApplicationName::Application.config.middleware.insert_before(Rack::Lock, Rack
r301 %r{.*}, 'http://www.yourdomain.example$&', :if => Proc.new {|rack_env
rack_env['SERVER_NAME'] != 'www.yourdomain.example'
}
end if Rails.env == 'production'
Which is saying, if the requested URL is not www.yourdomain.example then 301 redirect it to the www.yuordomain.example but only if it's running in production.
For this to work with Network Solutions do the following:
Network Solutions pointing yourdomain.example to www.yourdomain.example.
Here's how.
Within Account Manager, select My Domain Names
Select the domain name that you want to manage
In the green box, select Change Where Domain Points
Select Advanced DNS, then Continue
First, edit the A Records by selecting Edit A Records
*For the "# none" enter the following IP address 205.178.189.129, clear the records for the "www" and " (All others)"**,
then select Continue
Second, edit the Host Aliases (CNAME records) by selecting Edit CNAME Records
Enter "www" in the Alias column
Leave TTL set to 7200 but on the same line, enter the name servers provided by the blogging service in the Other Host section
[ IE
FOLLOW THE HEROKU INSTRUCTIONS NOW www --> yourapp.herokuapp.com (Cedar Stack) ]
Select Continue
Now wait and check the domain(s) with the following terminal command:
host domain.example
host www.domain.example

Google Apps: verify domain ownership using CNAME

I understand CNAME is an alias to another record. Since I am using melbourneIT for my domain name, when I set up Google Apps, I need to verify my domain name ownership through CNAME record change.
However when I see page: http://support.google.com/a/bin/answer.py?hl=en&answer=142005#CNAME (please tick "I want to verify using a CNAME record"), I am totally confused at what information to use in order to create the CNAME record for this verification purpose.
Please see below for the information from http://support.google.com/a/bin/answer.py?hl=en&answer=142005#CNAME:
Host Name/Alias Value/Destination
Custom URL: www ghs.google.com
Verification: googlefffggghhh12345 (your unique string) google.com
If my domain name is mydomainname.com, what should I put into my CNAME record (the value for HOSTNAME and POINTS TO, as in my DNS management panel shows)?
It's confusing because it looks like two entries. I think you want to use the second set of criteria for verification. So you'd enter the googlefffggghhh12345 as the alias(or host), and it would point to google.com.
You might want to do both or alternatively do mail as a cname and point it to ghs.google.com. You'll want to do that eventually anyway.
The cname, www pointing to ghs.google.com, is consistent with telling your domain host to check to see if there's a webpage setup in google sites and send people there. If there isn't one, and there isn't a sitemap within apps for one, I think the domain would just return to current hosting.