How to use naked GoDaddy domain with OpenShift hosting? [closed]
Desired Behaviour I have a GoDaddy domain name and am using OpenShift for hosting. I would like the following to be true: a) user enters www.mysitename.com > user sees mysitename.com b) user enters www.mysitename.com/about.html > user sees mysitename.com/about.html c) user enters mysitename.com or mysitename.com/about.html and they also see that url. d) to summarise, the www prefix is never displayed anywhere on the site. Constraints OpenShift hosting does not have a static IP, so it is not possible to adjust the A record at GoDaddy. The format for the OpenShift app is http://appname-username.rhcloud.com. You can set up a cname at GoDaddy with the following: www > appname-username.rhcloud.com This means the site is accessible at www.mydomain.com but not at mydomain.com. Suggested Solutions There are several posts on the topic that suggest the following but for several reasons are not adequate solutions: use a subdomain ie blog.mydomain.com use wwwizer use forwarding and masking (causes the url to stay the same when navigating relative links) Question 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"? Related Posts http://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? Edit This blog posts sums up the scenario: http://blog.cloudflare.com/zone-apex-naked-domain-root-domain-cname-supp Could I sign up for CloudFlare to resolve the issue? I haven't used it before and don't know how it works.
Solution 01) Sign up to cloudflare 02) Set these cname rules: mydomain.com > appname-username.rhcloud.com (this will utilise 'cname flattening') www > mydomain.com 03) Set page rules: http://www.mydomain.com/* > http://mydomain.com/$1 04) Set alias in OpenShift to mydomain.com 05) Make sure GoDaddy DNS record doesn't have any conflicting cname or A record set up. 06) Let it simmer overnight and all of the original desired behaviour should be working.
Here is what worked for me. Domain name : example.com openshift app: myapp-mydomain.rhcloud.com --on godaddy Domains>All Domains>select your domain example.com>click DNS ZONE FILE tab 1. delete www CNAME 2. create new Record with Record Type CNAME > HOST: www > POINT TO: myapp-mydomain.rhcloud.com 3. click Finish Click Settings tab 1. Forwarding > click Manage Forward to:www.example.com > Redirect: 301 (Permanent) > Type: Forward only 2. click ADD --on Openshift 1. select Application tab > select application myapp-mydomain.rhcloud.com > click change 2. enter Domain name www.example.com That's it. Wait for 10-15 min and see the magic.
To get your domain (with 'www' and without), to successfully point to your OpenShift alias, without 'masking' or 'forwarding' see this tutorial I wrote: How to get a custom domain and naked domains work for your OpenShift application It works with CNAME Flattening.
#Azghanvi: I faced the same problem. Make sure you add "www.example.com" as your alias in openshift and not "example.com". Seems like Godaddy does not support "example.com" by default.
set-env PATH in Openshift
Updating NPM on OpenShift
How to pass variable when adding a cartridge?
OpenShift Online: Change gear size of existing scaled application
Why do OpenShift action hook scripts fail with strange errors?
Xorg on OpenShift
Putting private information on Public PaaS?
OPENSHIFT - 'wsgi.py' does not contain WSGI application 'application'
How do I install pdftk on Openshift?
Openshift hooks during gear restart
Openshift - Unable to set the env in JBoss as7 cartridges
How can I make a custom 503 page on OpenShift?
Openshift: Cron job fails to run
OpenShift Enterprise creating directories in root file system
Restoring a dokuwki to openshift
gear size of more than one CPU / core in OpenShift Enterprise 2?