Hi all,
I have recently managed to get my custom domain (aiweb3consult.dk) to map to my canister on ICP, which is great! However, I am struggling to get HTTPS to work. Not sure if it is on the domain-provider end (using one.com) or if I am missing something on the ICP-side.
I have created an .htaccess file on one.com, which should redirect all traffic to the https version of aiweb3consult.dk. However, I have also done a redirect to my canister in the DNS settings page, and honestly it seems it is that redirect that does the trick in running the site on ICP rather than setting the CNAME, etc., because when I turn the redirect off I canât acces the site via the domain, even as the curl command used to check if registration went through returns âavailableââŚ
Hope someone out there can help me!
/Kenneth
1 Like
Hey @Kenneth-HM-Nielsen
On the boundary node side, everything is correctly configured and the custom domain has been successfully registered. You can verify that by running the following command, which directs the request directly to one of the boundary nodes:
curl -sLv -X GET \
--resolve aiweb3consult.dk:443:193.118.63.170 \
https://aiweb3consult.dk
I think the problem is in your DNS settings for aiweb3consult.dk
. At the moment, it only points to an IPv4 address that is owned by one.com. Ideally, you should set up a CNAME
/ANAME
/ALIAS
for your domain to aiweb3consult.dk.icp1.io
. If one.com doesnât support these record types for your domain, I recommend using Cloudflare instead. We provide some instructions on how to do that here.
Let me know if you have any further questions!
Hi @rbirkner,
Thanks for getting back to me!
This is what my DNS config looks like on one.com
(I scratched out the canister ID as I am tbh not sure if it is safe to share or notâŚ)
However, with those settings I get that âYour connection to this site is not secureâ in the browser bar. On the page it says that âhttps://aiweb3consult.dk.icp0.io/ may be temporarily downâ, but if I copy-paste the site-name from the browser it (still) says http://aiweb3consult.dk/⌠so I guess we are back to it probably being the HTTPS configuration at one.com not working!?
Really appreciate the help, as I am eager to get this site launched, so I can start advocating ICP on LinkedIn some more.
/Kenneth
Hey @Kenneth-HM-Nielsen
A âweb aliasâ from one.com is not a proper DNS setting, but more of a work-around that is specific to them. This is not a good way of doing it: basically, one.com just loads an iframe that loads the website inside it. This has many downsides: they list some in their docs under " What to consider before creating a Web alias".
You need a proper DNS redirect and for this, I recommend switching to Cloudflare (see the instructions here)
If you donât want to do that, you can also stick with one.com and have two options:
- Adding a web alias to
CANISTER_ID.icp0.io
. That comes with the downside that you wonât get support for HTTPS on aiweb3consult.dk
.
- Adding a web forward to
CANISTER_ID.icp0.io
. That comes with the downside that your users will be forwarded and will see the CANISTER_ID.icp0.io
domain in the address bar.
1 Like
Thanks again. I will have to try cloud flare it seems - just talked to support at one.com. Though I might go ahead and publish the site first where it directs to the domain-id version, so I can spin a story around how that is actually the canister ID, what a canister is, etcâŚ
1 Like
So I am back at it here. I have followed all the steps on DNS configuration guide | Internet Computer using CLOUDFLARE.
The only diff is that I still have a lot of Types/Records under the DNS Management part that I donât see in the example on DNS configuration guide | Internet Computer.
I can access the website fine through aiweb3consult.dk, but when I do
% curl -sL -X POST
-H âContent-Type: application/jsonâ
https://icp0.io/registrations
âdata @- <<EOF
{
ânameâ: âaiweb3consult.dkâ
}
EOF
I get
Failed to parse the request body as JSON: key must be a string at line 1 column 2
My .ic-assets.json file looks like
[
{
âmatchâ: â.well-knownâ,
âignoreâ: false
}
]
My .well-known directory contains only ic-domains which looks like
aiweb3consult.dk
My canister_ids.json file is
{
âwebsiteâ: {
âicâ: âbadct-3iaaa-aaaah-qpvya-caiâ
}
}
and my dfx.json file is
{
âcanistersâ: {
âwebsiteâ: {
âtypeâ: âassetsâ,
âsourceâ: [âassetsâ, âassets/imagesâ]
}
}
}
HELP! 
Your quite symbols are incorrect it should be "
instead of â
and â
.
1 Like
Thanks! Yes, I figured it out just after posting. Now I can register OK, but still when I do aiweb3consult.dk in the browser it still shows my canister ID, not the domain 
This is what the DNS records look like:
When I try to access on my phone, Chrome wonât let me in, because the domain uses an unsupported protocolâŚ
DNS changes take time to propagate, so your previous DNS config might still cause it to redirect until the change has been propagated down to the dns provider used by your phone.
OK, thanks!
But what about the domain still just pointing to the canister ID? Is that also a matter of time thing even as it has been confirmed (through curl -sL -X GET
https://icp0.io/registrations/REQUEST_ID) that the update to the boundary node has gone through?
Hey @Kenneth-HM-Nielsen
From my side everything looks good. I could open your page and could confirm that it is hosted on the IC. What makes you think it doesnât work?
@rbirkner yes just saw this morning
Seems all it took was time! Thanks for the support on here. And look out for my post on LinkedIn soon where I will use the announcement of my website to introduce ICP and Dfinity to my network.
1 Like