0048-00000301

Updated at:

Problem Description

When you access objects through an OSS-accelerated domain name, a preset 3xx redirection rule is triggered. The server returns HTTP status code 400 and denies the redirection request.

Causes

For buckets that have transfer acceleration enabled on or after 00:00:00 (UTC+8) on August 5, 2024, OSS denies 3xx redirection requests made through an OSS-accelerated domain name (bucketname.oss-accelerate.aliyuncs.com or bucketname.oss-accelerate-overseas.aliyuncs.com), whether signed or anonymous. The server returns HTTP status code 400 and the ExternalRedirectForbidden error code.

Examples

The following redirection rule is configured for a bucket:

The rule triggers on an HTTP status code of 404 and performs a 302 redirect to http://www.test.com/*.

If you access a non-existent object in the bucket, the redirection rule is triggered and the following error is returned:

curl -v http://test-demo.oss-accelerate.aliyuncs.com/not-exist-file
* About to connect() to test-demo.oss-accelerate.aliyuncs.com port 80 (#0)
*   Trying 127.0.0.1...
* Connected to test-demo.oss-accelerate.aliyuncs.com (127.0.0.1) port 80 (#0)
> GET /not-exist-file HTTP/1.1
> User-Agent: curl/7.29.0
> Host: test-demo.oss-accelerate.aliyuncs.com
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< Server: AliyunOSS
< Date: Wed, 05 Jun 2024 09:57:36 GMT
< Content-Type: application/xml
< Content-Length: 435
< Connection: keep-alive
< x-oss-request-id: 66603690A9D9AE14A2000036
< Location: http://www.test.com/not-exist-file
< x-oss-server-time: 105
< x-oss-ec: 0048-00000301
<
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>ExternalRedirectForbidden</Code>
  <Message>3xx redirect to public network is not allowed using the OSS endpoint, please use CNAME instead.</Message>
  <RequestId>66603690A9D9AE14A2000036</RequestId>
  <HostId>test-demo.oss-accelerate.aliyuncs.com</HostId>
  <EC>0048-00000301</EC>
  <RecommendDoc>https://www.alibabacloud.com/help/oss/support/0048-00000301</RecommendDoc>
</Error>

Solution

Use a custom domain name to access the objects to avoid denied redirection requests. For more information, see Access OSS through a custom domain name.