Custom domain breaks remix button functionality. fixable?


#1

I’ve enabled my glitch website project (https://incandescent-cylinder.glitch.me/) with a custom domain (https://www.ericlimer.com/) but in doing so, I appear to have broken the functionality of the Glitch button that allows users to view the code and remix. On the original URL, the button works fine, but on the custom URL it points users to https://www.glitch.me, a project by an unrelated user, instead.

Is there a way to fix this, or is it just the price of enabling a custom domain?


#2

Hi @ericlimer I think I see what you mean; i’m going to test it on one of my projects as well, but i’m wondering if you’d be willing to set up ericlimer.com (as opposed to www.ericlimer.com) on the same project. You may need to use an A record instead of a CNAME for that; our help docs on the subject can give you some guidance on the subject.

If you’re willing to set up that additional config please let me know what the results look like. I’ll report back with what I find in my own tests as well.


#3

thanks @cori! interested to hear the results of your test. On my end it appears that when I set it up without the www the Glitch button just disappears entirely.


#4

This is a result of the way the JavaScript for the Glitch button works; as written it won’t support projects on custom domains, which is why it doesn’t show up on ericlimer.com at all. On www.ericlimer.com the script mistakenly thinks your project is a completely different one, as you noted, but as it’s written there’s no way to get it to work transparently.

I’m going to bring this up to the team and we’ll see about rewriting the script to work better with custom domains.


#5

aha, yeah that squares with my suspicions. thanks for exploring it and taking the idea to the team, cori!


#7

Hey folks, the Glitch Button project has been updated to avoid this problem by preventing the button from displaying on custom domains similarly to how it won’t display on private projects.

To get it to work properly with custom domains we have some work to do on the back end, so that’s probably going to be a little while.