When you grant Alibaba Cloud CDN access to a private OSS bucket, CDN includes signature information in every request it forwards to OSS. This CDN access authentication is required for private bucket access. However, OSS static website hosting serves the default homepage only for anonymous (unsigned) requests. These two mechanisms conflict, so a root path request cannot load the default homepage.
Solution
Configure a URL rewrite rule in the Alibaba Cloud CDN console. The rule intercepts root path requests and redirects clients to index.html directly, bypassing the unsigned homepage lookup.
| Parameter | Value |
|---|---|
| Path to Be Rewritten | ^/$ |
| Target Path | /index.html |
| Flag | Redirect |
After you save the rule, the redirect works as follows:
Request:
www.example.com/CDN point of presence (POP) returns HTTP 302 and redirects the client to
www.example.com/index.html
This rule applies only to the root path (/). Requests for subdirectory roots such aswww.example.com/docs/are not affected and require separate URL rewrite rules.
For configuration steps, see Create an access URL rewrite rule.