Replies: 1 comment 2 replies
-
Is this now possible? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
At the moment, using
redirects to
https://myfirstsite.com/https://mysecondsite.com/test2
, when it should redirect to the external URL directly.This is something the Vercel CLI correctly warns about:
[WARN] [redirects] Redirecting to an external URL is not officially supported
.Background & Motivation
This is particularly useful to preserve links when migrating URLs into another domain or subdomain.
Goals
My own case was:
mysite.com
blog.mysite.com
, andmysite.com
now hosts an Astro website. Links such asmysite.com/article1
must redirect toblog.mysite.com/article1
.It is possible to use redirect lists in Cloudflare but this costs too much if the list of URLs is too large.
Redirecting with Astro allows to maintain this list more easily (as it can be contained in a plain text file such as a JSON or JS file).
Beta Was this translation helpful? Give feedback.
All reactions