GAE naked to www custom domain mapping does not work

冷暖自知 提交于 2019-12-03 12:14:18

While it's true Google doesn't officially support naked domains, it is possible to make this work using your registrar's DNS and Domain Forwarding tools.

For example, http://conversionsupport.com is hosted on Google App Engine, and GoDaddy is where the DNS is managed. The naked domain redirects to the http://www.conversionsupport.com subdomain using a domain forwarding rule.

Requests for the naked domain result in a 301 redirect to the www subdomain. Some SEO resources claim that using one subdomain is better for ensuring search engines don't see your site's content as being duplicative. This 301 redirect should help ensure that both naked domain and www subdomain are treated the same.

Here is a resource for Setting up URL Forwarding in GoDaddy. Note that while this is intended for Google Sites, I have confirmed that it does work on Google App Engine apps.

UPDATE:

To clarify, the naked domain itself will redirect to the www subdomain. This means that if your users type http://example.com then they'll be redirected to http://www.example.com as is the case with my original example above.

From what I understand, most Google Apps accounts are partnered with GoDaddy. Here are the Instructions from GoDaddy Support on Domain Forwarding Using a 301 Redirect..

Naked domains are not supported on App Engine. You need to use www-redirects, as you suggest.

Naked domain (e.g. yourdomain.com) support for App Engine can be setup in three steps:

  1. Setup a naked domain redirect to a subdomain of your choice (e.g. redirect mydomain.com -> www.mydomain.com). See the App Engine FAQ, which instructs you to configure the redirect via the Google Apps control panel for your domain.

  2. Configure App Engine to serve traffic for your custom subdomain (e.g. www.yourdomain.com) via the Google Apps control panel.

  3. (Optionally), setup SSL for your custom domain. This step is required if you which to serve https:// traffic, but not required if you only plan on hosting http:// content.

As nick says, naked domains are not supported by app engine.

On your point of easier methods to achieve naked to www redirection on custom domains... Some DNS hosts, (for example, dyndns.com) integrate that ability into their DNS control panel. You may check with your DNS provider to see if that is the case.

With all the changes over time, I wanted to post that GAE (at least at the time of this writing) DOES support naked domains. I have this working for wdydfun.com. Follow the directions as mentioned above by Fred Sauer and it will eventually work. I'd love to provide more detail on those steps, but things seem to change frequently. You'll have to click around a bit to find where to set stuff. With the DNS propagation time that can be a bit frustrating. I recommend running

dig ns <your url>

from the command line to help see what is going on. My "www" domain was resolving to ghs.google.com and my naked domain was resolving to dreamhost where the domain was registered. After filling out the extra "A" records from the google directions, the naked domain eventually started returning different information and it worked. If you are testing this out in a browser, it's worth mentioning that at the time of this writing webkit browsers seem to be pickier than mozilla. My DNS settings:

  A     216.239.32.21
  A     216.239.34.21
  A     216.239.36.21
  A     216.239.38.21
  TXT   google-site-verification=W0rC...fnQ
* CNAME ghs.google.com.

Yours will probably look similar. Unless the directions have changed again. The CNAME value changed since when I first set things up, so if what I'm writing here differs from the directions on Google, trust the directions on Google. HTH.

Naked domain mapping works from the Google Developers Console.

https://code.google.com/p/googleappengine/issues/detail?id=777

We have added support for custom domains for App Engine from the Google Developers Console, meaning you can now associate a custom domain without first associating that domain with Google Apps.

To access the feature, visit https://console.developers.google.com/ and you will find the option to add a custom domain under App Engine > Settings.

NOTE: Currently we do not support SSL on custom domains created through this method (although we expect to rectify this in a future release). In the meantime, we continue to support SSL (via VIP or SNI) for custom domains that are created through Google Apps, and we continue to provide free HTTPS for all *.appspot.com domains.

Alternatively, you could follow below steps which solves this problem, for sure,

  1. Ping the website you are wanting to forward to, in order to get the IP address if you don't know it.

  2. "Run"; CMD; "ping yourwebsite.com"

    Will display ping data and reply from IP address. Note this address.

  3. Login to Godaddy.com to manage your account or other domain registry site

  4. Go to DNS Control Modify/Add "A Host"

  5. Under "Host" enter: @

  6. Under "Points To" Enter the IP Address you obtained earlier.

  7. You are done! Site is forwarded without the www prefix when entered into address bar.

More details and reference :

http://www.techproceed.com/2014/05/custom-domain-setup-on-blogger-with.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!