Domain claims and its woes

Posted by tobi — 01:52 PM Mar 26

One of Shopify’s best features is that it allows you to use your own domain. The system we use involves “claiming” a domain and then going to your hosting provider and forwarding this domain using a CNAME to our servers. So once a request for an unknown domain comes to shopify we consult the claimed domains table and see if we can match it up with one of our customers.

This system works incredibly well and leads to some great integrations of Shopify with other software packages such as Mephisto. Endoborn is a great example of this.

There are some problems with this system such as the absolutely arcane user interfaces of most domain registrars.

Well this is a problem which can be solved. More about this at a later date.

Some of those registrars also offer a simple method of domain forwarding: DNS Masking. This works by hosting a frameset on the customers domain which just includes the real URL as its only frame. The browser will happily show the right domain name but it will do so regardless where on the page you are. Any detail urls are lost because all the normal disadvantages of framesets apply. So instead of showing http://www.snowdevil.ca/products/titan it would still show http://www.snowdevil.ca/.

It gets worse: As it happens Internet explorer rejects all cookies from third party included domains. This is a deadly blow to Shopify because cookies are a minimum requirement for its operation. Firefox and Safari do not have this error so many of our store owners set up DNS masking and test it successfully in Firefox only to discover months down the road that Internet Explorer users cannot add items to their shopping cart.

Update: I finally found some documentation on the issue. IE wants your server to implement a Compact P3P policy statement which is a special header describing what you intend to do with the cookies. This is one of those utter garbage standards the w3c dreamed up before it imploded. Bad standards attract bad programmers so obviously Internet Explorer uses it.

To fix this just add the following code to the very top of your application.rb class:


before_filter { |c| c.headers['P3P'] = %|CP="NOI DSP COR NID ADMa OPTa OUR NOR"| }

I don’t really care what this line means. I regard it as a fix for a broken browser.

Update2: References—

Comments

  • Peter Cooper 26 Mar 15:35

    Aha! This would explain why my girlfriend set up a store, tried to use it for a few months, and got lots of bitching from people about it not working. I tested on all my browsers (including IE – which I have set to be pretty liberal) and it worked fine so I wrote them all off as idiots. She doesn’t do that business anymore, lol.

    So.. does Shopify now have this ‘fix’?

  • Jonathan Snook 26 Mar 16:05

    Can you link through to the documentation you’ve found?

  • Tobi 26 Mar 17:49

    Peter: Yes Shopify has the fix now.

    Jonathan: I linked the references i found.

  • Dan 29 Mar 16:54

    I think an easier solution would be to host your own domain service. At the registrar, change the dns server setting to your dns server and come up with a web interface such as everydns.net. Then there is one interface, that you control.

  • ehovah2799@blog.leetsoft.com Content-Transfer-Encoding: quoted-printable Content-Type: text/html 30 Mar 22:32

    nowaris3206@blog.leetsoft.com

Commenting are now closed…