This feature is only available for Pro plans and above.
When you add a custom domain to your project, Dub will automatically create a placeholder page for your domain. This page will be displayed when you visit your domain.
To redirect your domain to a URL of your choice, follow these steps:
- If you haven't already, upgrade to the Pro plan.
- Navigate to your project's Domains page – you can do that by clicking on the Domains link in the menu bar at the top of your project dashboard.
- Click on the Edit button next to the domain you want to redirect to open up the Domain Settings modal.
- Enter the URL you want to redirect your domain to in the Landing Page field.
- Click "Save changes".
In certain cases, you might want to rewrite your domain to a given URL (also known as URL masking or cloaking).
You can do that simply by setting the Behavior field of your custom domain to "Rewrite" in the Domain Settings modal:
A few caveats for the URL masking feature:
- This feature is only available for Pro plans and above.
- URL masking might not work for certain websites that have security measures in place to prevent this (e.g.
twitter.com). Potential errors include:
- The domain redirects instead of rewriting
- Domain keeps redirecting (
- For certain Next.js websites, URL masking might cause broken CSS styles (e.g.