Problem description
The "SecondLevelDomainForbidden" error was returned for a resource request to Object Storage Service (OSS). The following content shows the error details:
Error message 1:
The bucket you are attempting to access must be addressed using OSS third level domain.Error message 2:
Please use virtual hosted style to access.
Causes
Cause of error message 1: The domain name in the request is not a third-level domain.
Cause of error message 2: A host error occurs.
Solutions
Modify your request based on the returned error message:
Error message 1: Include third-level domains that contain information about buckets in all requests except the requests that you send to perform the GetService (ListBuckets) operation. The domain name used to access a bucket is in the
BucketName.Endpointformat. BucketName indicates the name of the bucket and Endpoint indicates the endpoint of the region in which the bucket is located. An example of a valid OSS domain name ishttps://examplebucket.oss-cn-hangzhou.aliyuncs.com.Error message 2: When you access OSS over the Internet, use the URL of the object that you want to access to specify the object. For more information, see OSS domain names. The URL of an OSS object is in the
[$Schema]://[$Bucket].[$Endpoint]/[$Object]format. For example, if you want to access an object namedexample.txtin the destfolder directory of the bucket named examplebucket in the China (Hangzhou) region, you can use the following URL:https://examplebucket.oss-cn-hangzhou.aliyuncs.com/destfolder/example.txt.Note[$Schema] is the schema of the URL. Valid values: HTTP and HTTPS.
[$Bucket] is the name of the bucket.
[$Endpoint] is the endpoint of the region in which the bucket is located. For more information, see Regions and endpoints.
[$Object] is the path to the object that you want to access.
Applicable scope
OSS