arcane
arcane

Reputation: 457

Does anyone know the appropriate method to use a domain name with a openshift application

I have spent the better half of two days trying to figure out how to do what should be the easiest thing in the world. I have registered a domain with godaddy and need the appropriate method in which to use it with a application built with the laravel framework hosted on on openshift site.

  1. example domain name is www.example.com
  2. aliases with openshift www.example.com & example.com
  3. register currently has me setting my A host to the oppenshift app ip which is fine until the ip gets changed(so obviously not the correct way of doing it)
  4. even doing #3 when going to www.example.com the www. remains in the address bar.
  5. and yes I have looked at every forum thread on openshift & it seems they are all nothing shy of workarounds. I would think the correct way of doing this would be documented somewhere on this site but yet to find a definitive answer?

I would like to know the appropriate way of doing this if anyone knows, not just some work around that could potentially have negative implications down the road be it seo or response time.

I starting to draw the conclusion that this is more suited for development of apps and not actual hosting seens how something this important it seems almost impossible to find a correct direction.

thx in advance for any guidance.

Upvotes: 1

Views: 867

Answers (3)

aviggiano
aviggiano

Reputation: 1913

If you want to forward your domain.com to www.domain.com, you can use a naked domain redirect provider.

Upvotes: 0

arcane
arcane

Reputation: 457

So after much research I found out this a common this when using Paas. The problem stems from not being able to point your A host(zone apex)to a cname. You would normally point your A host to the IP addres of you application but with most Paas this IP can change unannounced. I finally settled on using a 301 redirect from my zone apex to a cname www that points to my application on openshift. This works great but does not allow for naked url in the address bar when someone goes to say example.com as everything redirects to www.example.com. No biggy just looks cleaner without the www. in the url. Currently looking into using CloudFlare CDN as I think I will be able to use my zone apex(naked domain) as a cname that points to my openshift application to accomplish the naked(non www.) address bar look.

http://blog.cloudflare.com/zone-apex-naked-domain-root-domain-cname-supp this link was great about describing the issues faced with this topic.

Thax once again jason

Upvotes: 0

Jordan Liggitt
Jordan Liggitt

Reputation: 18111

There should be just two steps to make the www url work:

  1. Add a CNAME record for your domain
  2. Add an alias for your domain using rhc or the OpenShift console

Take a look at https://www.openshift.com/blogs/custom-url-names-for-your-paas-applications-host-forwarding-and-cnames-the-openshift-way

For the non-www url, from the blog post:

If you want to forward over your whole domain, such as mycompany.com and not www.mycompany.com, then you either need to use Domain Forwarding or find a DNS provider that allows "Naked" CName records. Domain forwarding uses a web server to do a redirect.

You can forward the non-www domain to the www one, where the CNAME record will work.

Upvotes: 3

Related Questions