And they have a website on the main domain (empresa.com.br)
The thing is, we now need to configure these subdomains so that any attempt to access the www version (www.b2b.empresa.com.br) gets redirected to the primary version, without www (b2b.empresa.com.br).
I know that VTEX’s documentation doesn’t recommend this setup, and that they recommend the primary version to be with www. But the client already came this way
Is there any configuration to be done via DNS or .htaccess?
We’ve already tried a few things in DNS with no luck, but we haven’t tried .htaccess yet.
Thanks in advance to anyone who has experience with these cases and can help
In theory, all DNS configuration depends heavily on which provider the client is using. Do you know which one it is? Basically, the provider should supply some additional documentation to complement what VTEX already recommends.
In general, it’s possible to redirect to a subdomain by applying the non-www approach.
According to the documentation, you would need to create a www entry on the domain server where the additional subdomains are hosted.
I still don’t know who the provider is, I’ll look into it.
We tried adding a CNAME with the name “www.empresa” and the value also starting with www, but it still didn’t work.
Are you suggesting I should create just a www entry and point it to empresa.site.com.br as well? Wouldn’t that cause a conflict with the main domain site.com.br?
However, you mentioned the subdomains. If they’re registered, you’ll need to go through the process with them.
What you could try is creating the entry with and without www for the subdomain, redirecting one to the other, as shown here: Redirecting one address to another
As for conflicts, if you set up the subdomain correctly, I don’t think there will be any.
One more thing: check with your provider whether you have any limitations when it comes to configuring subdomains.
Perfect, @four2one!
Thank you so much for the guidance. We’ll make these configurations and I’ll come back here to let you know if it worked — someone in the community might go through the same thing too.
It’ll just take a little while since it depends on the client’s IT team lol
We set up the DNS records to point to the redirector, as described in the documentation, but it didn’t work.
First we tested by adding a CNAME for each version, and both started working. Then we removed the CNAME for the non-www version, created an A record with the redirector’s IP and the redirect CNAME, as shown in the image:
Can you take a look and see if something’s wrong? It looks fine to me — we did this on Monday, so if it were a timing issue, the DNS should have propagated by now.
In what sense do you mean?
According to the documentation, you need to log into the panel in the domain settings section and save again, without changing anything. This notifies VTEX about the DNS changes. Is there anything else to do besides that?
According to VTEX, you need to open a ticket informing them about the DNS switchover, so they can monitor it and make the routing adjustment on their end to IO.
I’m not sure if you’ve already managed to solve your problem, but I wanted to share another option: the Redirect-301 service works similarly to direcionar.com.br, which is mentioned in the VTEX help docs, but with the advantage of supporting HTTPS.
The setup is pretty straightforward – you just need to add two records in your DNS – and if you need help, the team has a WhatsApp group where they assist you quickly. The service does have a cost, but it’s almost symbolic – less than $1 USD per month, with no request limits. (You can try it for free in the first month using the code REDIRECT.)
We haven’t resolved it yet. We made the configurations correctly, then asked for vtex support intervention and they provided another redirect service, the redirect center. That didn’t work either and they asked us to go back to the direcionar. We’re waiting for their response and I’ll come back here to close the case. Thank you for the suggestion, I’ll bring it up with the company.