Skip to content

Instantly share code, notes, and snippets.

@kyletaylored
Created March 5, 2020 20:47
Show Gist options
  • Save kyletaylored/28ad2e1a0d6f140c3c7d96256d548dd9 to your computer and use it in GitHub Desktop.
Save kyletaylored/28ad2e1a0d6f140c3c7d96256d548dd9 to your computer and use it in GitHub Desktop.
DU Redirect VCL
if (obj.status == 902) {
set obj.status = 301;
set obj.http.location = "https://domain.com" obj.response;
set obj.response = "Moved Permanently";
synthetic {""};
return (deliver);
}
if (req.url.path ~ "(?i)^/example(($|/|\?).*)") {
error 902 "/anotherdirectory" re.group.1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment