如何在OpenShift托管中使用裸GoDaddy域? [英] How to use naked GoDaddy domain with OpenShift hosting?
问题描述
期望的行为
我有一个GoDaddy域名,并且正在使用OpenShift进行托管.
I have a GoDaddy domain name and am using OpenShift for hosting.
我希望以下几点是正确的:
I would like the following to be true:
a)用户输入www.mysitename.com
>用户看到mysitename.com
a) user enters www.mysitename.com
> user sees mysitename.com
b)用户输入www.mysitename.com/about.html
>用户看到mysitename.com/about.html
b) user enters www.mysitename.com/about.html
> user sees mysitename.com/about.html
c)用户输入mysitename.com
或mysitename.com/about.html
,他们还将看到该URL.
c) user enters mysitename.com
or mysitename.com/about.html
and they also see that url.
d)总而言之,www
前缀永远不会显示在网站上的任何地方.
d) to summarise, the www
prefix is never displayed anywhere on the site.
约束
OpenShift主机没有静态IP,因此无法在GoDaddy上调整A record
.
OpenShift hosting does not have a static IP, so it is not possible to adjust the A record
at GoDaddy.
OpenShift应用程序的格式为http://appname-username.rhcloud.com
.
The format for the OpenShift app is http://appname-username.rhcloud.com
.
您可以使用以下命令在GoDaddy设置cname:
You can set up a cname at GoDaddy with the following:
www > appname-username.rhcloud.com
这意味着可以在www.mydomain.com
上访问该站点,但不能在mydomain.com
上访问该站点.
This means the site is accessible at www.mydomain.com
but not at mydomain.com
.
建议的解决方案
关于该主题的几篇文章提出了以下建议,但由于某些原因,这些解决方案还不够完善:
There are several posts on the topic that suggest the following but for several reasons are not adequate solutions:
-
使用转发和屏蔽(在浏览相对链接时,URL保持不变)
use forwarding and masking (causes the url to stay the same when navigating relative links)
问题
有人能想到满足上述预期行为的另一种解决方案吗?
Can anyone think of another solution that satisfies the desired behaviour stated above?
还是我需要更改为允许裸名记录"的注册商?
Or do I need to change to a registrar that allows "naked cname records"?
相关帖子
https://stackoverflow.com/questions/18431034/godaddy-domain-pointing -to-openshift-hosting
带有Openshift的裸域
如何为带有OpenShift的裸域?https://stackoverflow.com/questions/18431034/godaddy-domain-pointing-to-openshift-hosting
Naked domain with Openshift
How do I add an alias for a naked domain with OpenShift?修改
此博客文章总结了这种情况:
This blog posts sums up the scenario:
http://blog.cloudflare.com /zone-apex-naked-domain-root-domain-cname-supp
我可以申请CloudFlare解决该问题吗?
Could I sign up for CloudFlare to resolve the issue?
我以前从未使用过它,也不知道它是如何工作的.
I haven't used it before and don't know how it works.
推荐答案
解决方案
01) 注册到cloudflare
02)设置以下cname规则:01) Sign up to cloudflare
02) Set these cname rules:mydomain.com > appname-username.rhcloud.com
(这将利用"名称拼合')www > mydomain.com
03):设置页面规则:
http://www.mydomain.com/* > http://mydomain.com/$1
04)在OpenShift中将别名设置为
mydomain.com
04) Set alias in OpenShift to
mydomain.com
05)确保GoDaddy DNS记录没有设置任何冲突的
cname
或A record
.05) Make sure GoDaddy DNS record doesn't have any conflicting
cname
orA record
set up.06)让它overnight煮一整夜,所有原来想要的行为都应该起作用.
06) Let it simmer overnight and all of the original desired behaviour should be working.
这篇关于如何在OpenShift托管中使用裸GoDaddy域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!