Can I redirect all [subdomain].pages.dev requests to my custom domain in a * to $1 way?

Hi,

This is a really stupid question, but I can’t seem to figure this out even after reviewing the documentation and the other threads on this. I tried adding this redirect rule:

example.pages.dev/* https://example.example.com/:splat 301

And it did not work. I’m not familiar with the splat feature and I’m thinking I may have just made some really silly syntax error or something. Is there any way to achieve this? Thank you.

-tls2point0

You can do this with Bulk Redirects, but not with Page Rules because you can’t go into the *.pages.dev zone to create a Page Rule.

So, go to Bulk Redirects in the Dashboard and first create a redirect list.

Then add just one item to that list:

This (with the options checked) will redirect requests to example.pages.dev to example.com, example.pages.dev/foo/ to example.com/foo/, and abc123.example.pages.dev to example.com. That last one will prevent you from looking at specific deployments, so if you want to be able to do that, uncheck “include subdomains”.

2 Likes

Thank you for the help!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.