Is there a way to have CloudFront Behavior recognize a double slash at the beginning of a path

272 Views Asked by At

CloudFront beginner here.

We have situations where, due to circumstances outside our control, URLs can appear on our sites with double slashes in the path. This is particularly an issue when the double slashes appear at the beginning of the path. our old provider could handle this fine, but I cannot find a rule syntax that will convince CloudFront to recognize a double slash.

For instance http://ourdomain. com//longnumber/uniquepath/image.jpg . We want to use a behavior to forward this to our webserver for "correction" (a lambda function is off the table for now even if i could catch the slashes), but i've tried

//, *//*, //* 
\/\/, *\/\/*, \/\/*
/\/* (as above), "//", and even more. 

and it would not recognize the image/document when refreshed (without cache, and with an invalidation executed just in case)

We would be serving thousands of requests, with only a few here and there with double slashes, so we don't want to forward everything, it would defeat the purpose - and our default behavior is, neccecarily, pointed elsewhere.

It would be handy to be able to intercept double slashes anywhere in the path, but the primary concern is at the beginning of the URL.

Any help would greatly be appreciated.

0

There are 0 best solutions below