Currently I'm trying to redirect from root.com/robots.txt to beta.root.com/robots.txt.
This is not working currently, any idea why?:
{
"version": 2,
"alias": ["root.com"],
"routes": [
{
"src": "/(.*)",
"status": 301,
"headers": { "Location": "https://beta.root.com/$1" },
"dest": "/$1"
}
]
}
You should not use
destif you don't plan on proxy/rewriting requests.Since you want the client to redirect, all you need is the header.
If you want to redirect everything, use a wildcard:
View Documentation
Update 2020
You can now use
redirectswhich is a little easier.View Documentation