Configuring Redirection
You can redirect all requests for a bucket to another bucket or URL by configuring redirection rules.
Prerequisites
Web page files required for static website hosting have been uploaded to the specified bucket.
The static website files hosted in the bucket are accessible to all users.
Procedure
- In the bucket list, click the bucket you want to operate to go to the Objects page.
- In the navigation pane, choose Overview.
- In the Basic Configurations area, click Static Website Hosting. The Static Website Hosting page is displayed.
Alternatively, you can choose Basic Configurations > Static Website Hosting from the navigation pane on the left.
- Click Configure Static Website Hosting. The Configure Static Website Hosting dialog box is displayed.
- Enable Status.
- Set Hosting Type to Redirect requests. In the text box of Redirect To, enter the bucket's access domain name or URL.
- Click OK.
- In the bucket list, click the bucket to which requests for the static website are redirected.
- (Optional) If the static website files in the bucket are not accessible to everyone, perform this step. If they are already accessible to everyone, skip this step.
To grant required permissions, see Granting Anonymous Users Permission to Access Objects.
If the bucket contains only static website files, configure the Object Read-Only policy for the bucket, so that all files in it are publicly accessible.
- Choose Permissions > Bucket Policies.
- Click Create.
- Configure bucket policy information.
Table 1 Parameters for configuring a public read policy Parameter
Description
Configuration method
Visual Editor and JSON are available. Choose Visual Editor here. For details, see Creating a Custom Bucket Policy (JSON View).
Policy Name
Enter a custom policy name.
Policy content
Effect
Select Allow.
Principals
Select All accounts.
Resources
- Select Specified objects.
- Set the resource path to * (indicating all objects in the bucket).
Actions
- Choose Use a template.
- Select Object Read-Only.
- Click Create. The bucket policy is created.
- Verification: Input the access domain name of the bucket in the web browser and press Enter. The bucket or URL to which requests are redirected will be displayed.
In some conditions, you may need to clear the browser cache before the expected results are displayed.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot