What do I do if the ExternalRedirectForbidden error code is returned?

更新时间:
复制 MD 格式

OSS returns HTTP 400 and ExternalRedirectForbidden when a redirection rule fires on a request that uses the bucket's public domain name or OSS-accelerated endpoints for anonymous or signed-URL access. Switch to a custom domain name to resolve it.

Why this happens

This error affects buckets created (or with transfer acceleration enabled) on or after 00:00:00 (UTC+8) on August 5, 2024. When a preset redirection rule (HTTP 3xx) is triggered on such a bucket, OSS blocks the redirect if the request came in through either of the following endpoint types:

Endpoint typeDomain formatRedirect support
Public domain namebucketname.oss-[region].aliyuncs.comBlocked for anonymous and signed-URL access
OSS-accelerated endpointsbucketname.oss-accelerate.aliyuncs.com
bucketname.oss-accelerate-overseas.aliyuncs.com
Blocked for anonymous and signed-URL access
Custom domain nameYour own domain bound to the bucketAllowed

Solution

Bind a custom domain name to your bucket and access objects through it. Custom domains support redirection rules without restriction.

For setup instructions, see Map a custom domain name to the default domain name of a bucket.