1 Answer
- Newest
- Most votes
- Most comments
0
%C0
is the url encoding for À
in the Windows-1252 encoding scheme. You should encode your url-query strings in utf8.
For À
this would be %C3%80
.
I setup my redirect as follows (same as yours just left out the protocol.
% aws s3api get-bucket-website --bucket static.swyd.ca --region eu-west-1
{
"RedirectAllRequestsTo": {
"HostName": "swyd.ca"
}
}
When I test this with %C0
it fails:
% curl -vko /dev/null http://static.swyd.ca.s3-website-eu-west-1.amazonaws.com/%C0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 52.218.97.236:80...
* Connected to static.swyd.ca.s3-website-eu-west-1.amazonaws.com (52.218.97.236) port 80 (#0)
> GET /%C0 HTTP/1.1
> Host: static.swyd.ca.s3-website-eu-west-1.amazonaws.com
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< x-amz-request-id: D5RTSV1DKFXB8PRQ
< x-amz-id-2: DLiV+/FbrPj5myRI7HhUuBJb3M=
< Content-Type: text/html; charset=utf-8
< Date: Fri, 18 Aug 2023 08:11:20 GMT
< Server: AmazonS3
< Content-Length: 348
< Connection: close
Using UTF8 encoding it works:
% curl -vko /dev/null http://static.swyd.ca.s3-website-eu-west-1.amazonaws.com/%C3%80
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 52.218.37.188:80...
* Connected to static.swyd.ca.s3-website-eu-west-1.amazonaws.com (52.218.37.188) port 80 (#0)
> GET /%C3%80 HTTP/1.1
> Host: static.swyd.ca.s3-website-eu-west-1.amazonaws.com
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< x-amz-id-2: fzEpLLxY4XH+6/dfgzCCfEaQ9AaH++=
< x-amz-request-id: CDSCQ3ND8
< Date: Fri, 18 Aug 2023 08:14:00 GMT
< Location: http://swyd.ca/%C3%80
< Server: AmazonS3
< Content-Length: 0
Relevant content
- asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 months ago
Appreciate your response, but this is different from my question. I can't control the things people type into their URL bar, and I'm not trying to. I'm trying to understand why the bucket returns a 400 ever given that I've set it to always redirect.
Appreciate your response, but this is different from my question. I can't control the things people type into their URL bar, and I'm not trying to. I'm trying to understand why the bucket returns a 400 ever given that I've set it to always redirect.