Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: www_lsst_io
-
Labels:None
-
Story Points:2.1
-
Epic Link:
-
Team:SQuaRE
-
Urgent?:No
Description
It is really nice that the search fills in the URL so it can be copied and shared, but using the URL results in a redirect loop. This can be triggered by either:
1 doing a search and hitting the reload button in the browser
2 clicking on this link
I think we've cracked this. One change that needed to be be made was in the search app to always include a trailing slash in the path (i.e. /search/?query=vault). Gatsby natively prefers trailing slashes. Before we were rewriting the browser URL with just the directory name (i.e. /search?query=vault), but that actually triggers a 301 redirect on the client.
Second, we've modified the Fastly Varnish configuration for directory redirects to access the index.html file in the S3 bucket if the path ends with a trailing slash.
Before, the redirect VCL was:
}
The new redirect VCL is:
}
So the key parts of this are: