Remove Vercel Deployment Aliases

I want to remove the extra domains assigned to my project and keep only my production and preview domains.

I don’t want to have the myproject-myproject.vercel.app or myproject-git-main-myproject.vercel.app domains.

I tried removing them with vercel CLI but the keep appearing in each branch deployment.

How I can do this?

Thanks :smiley:

The domain troubleshooting guide can help with most custom domain configuration issues. You might be able to use that guide to solve it before a human is available to help you. Then you can come back here and share the answer for bonus points.

You can also use v0 to narrow down the possibilities.

Hey @suituxr. Every deployment gets its own unique deployment URL. You can prevent others from using it by leaving the standard Deployment Protection option enabled. I hope that helps!

Hi Amy, thanks for the response.

The thing is that I want only url of accessing production.

Now, when I deploy into Vercel, it deploys to myapp.com, myapp-git-main-myapp.vercel.app and myapp-myapp.vercel.app.

And I only want to be deployed to myapp.com domain.

The project it’s integrated with Vercel with the Github integration.

Hope I’ve explained :slight_smile:

Thanks!

Also,

If I execute vercel alias rm myapp-git-main-myapp.vercel.app -y | vercel alias rm myapp-myapp.vercel.app -y the problem it’s gone, but I think that it’s not the solution. WDYT?

You can remove the myapp.vercel.app domain in project settings to eliminate that from being aliased to new deployments. But the Git generated URL and the unique deployment URL are aliased automatically. If you prefer not to use them, you can ignore them. They are not accessible to anyone else unless you disable Deployment Protection.

1 Like

But… this not true I think.

I’m using the Hobby plan and I have the Deployment Protection enabled:

And when I try to access (from a different device where I don’t have the Vercel Account) to myapp-git-main-myapp.vercel.app and myapp-myapp.vercel.app they are accessible.

Also, I’m using Cloudflare as Reverse Proxy, that’s why I don’t want to expose the other urls.

Sorry, I replied you but I didn’t click the reply button haha

Hi @suituxr, as Amy pointed out earlier you can remove the project level domain *.vercel.app from the Domains section in the project settings. But, Vercel will still assign unique URLs to your deployments.

The Vercel Authentication only applies to deployment specific URLs and not to any production level domain. See the image below:

If you try and access a deployment URL (example from the above project), you will be redirected to Vercel login page.

That being said, if you don’t expose these Vercel URLs, you won’t receive traffic there. These URLs do not interfere with your Cloudflare proxy settings, so you can continue using that with the production deployments.

TL;DR: There is no real downside to these auto-generated URLs, as long as your website is secure.

Hi Anshuman!

Yes, I’ve removed myapp.vercel.app and it’s fine, but the problem its that when a push it’s made to the main branch, it creates the myapp-git-main-myapp.vercel.app and myapp-myapp.vercel.app domains and they are accesible with the Deployment Protection enabled.

As you can see in the domains of the production deployment overview:
image

Those domains that Vercel creates, are accessible from unauthenticated.

I have the deployment protection enabled as you can see:

The only way to delete this domains that Vercel automatically creates, is deleting them thought the Vercel CLI.

There is a screenshot of the project’s domains:

(The .com’s are in red because I have a Cloudflare Access protection)

Thank you :slight_smile:

Hi @suituxr, thanks for adding more information but as we stated above these auto-generated domains can not be deleted forever, they will reappear when you deploy a new version.

Only the production deployment URLs is accessible without authentication. The URL in your screenshot is from the main branch, which would be pointing to the production deployment.

There is no risk of exposing them and you can ignore them safely.

Okey, I understand, but… yes, there is a risk.

The auto-generated domains are not going throught the Cloudflare Proxy, so if there is any DDOS or something, it will be Vercel with his Firewall that catches them, not Cloudflare.

Also, I don’t want anybody to access to the Production environment without using Cloudflare as Reverse Proxy.

There is no solution to avoid auto-generating this domains?

Thanks for the support :smiley:

Hi @suituxr, the DDoS risk for the deployment URLs is very low.

But, the DDoS Mitigation feature will be enough for those instances.

Yes, there is no method to stop generating the deployment level unique URLs.

Rest assured, you’ll be fine with the DDoS protection Vercel provides.

Thanks for using Vercel and the joining community. You can always post here your questions.

1 Like

Okey, thank you for your support.

I’ll do a trigger that executes “vercel alias rm myapp-git-main-myapp.vercel.app -y | vercel alias rm myapp-myapp.vercel.app -y” when a production environment it’s deployed.

Also, it would be a great feature to disable the automatic domain creation.

Thanks for the support :smiley: