0048-00000300

Updated at:

Problem Description

When you use the default public domain name of a bucket to access objects in the bucket, a preset redirection (an HTTP status code 3xx for redirection) rule is triggered. As a result, the redirection request is denied.

Causes

To enhance data security, if you use the default public domain name of a bucket created on or after 00:00:00 (UTC+8) on August 5, 2024 to access objects in the bucket anonymously or by using a signed URL, a preset redirection (an HTTP status code 3xx for redirection) rule is triggered and the redirection request is denied. The HTTP status code 400 and the ExternalRedirectForbidden error code are returned.

Examples

In this example, the following redirection rule is configured for a bucket:

The back-to-origin type is Redirect: Add Prefix and Suffix, the back-to-origin condition is HTTP status code 404, the back-to-origin address is http://www.test.com/*, and the Redirect Code is 302.

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

curl -v http://test-demo.oss-cn-hangzhou.aliyuncs.com/not-exist-file
* About to connect() to test-demo.oss-cn-hangzhou.aliyuncs.com port 80 (#0)
*   Trying 127.0.0.1...
* Connected to test-demo.oss-cn-hangzhou.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-cn-hangzhou.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-00000300
<
<?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-cn-hangzhou.aliyuncs.com</HostId>
  <EC>0048-00000300</EC>
  <RecommendDoc>https://www.alibabacloud.com/help/oss/support/0048-00000300</RecommendDoc>;
</Error>

Solutions

Use a custom domain name to access the objects. In this case, requests are not denied. For more information, see Access OSS through a custom domain name.