-
-
Save blueprintmrk/ac57b2067327446485030a748255e3de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| table redirects { | |
| "/Advocate": "https://www.dosomething.org/us/campaigns/suspended-what-advocate", | |
| "/After-School": "https://www.dosomething.org/us/campaigns/mirror-messages", | |
| "/Amplify": "https://www.dosomething.org/us/campaigns/suspended-what-amplify", | |
| "/Andrea": "https://www.dosomething.org/us/campaigns/show-stress-whos-boss", | |
| "/BootcampNYC": "https://www.eventbrite.com/e/dosomethingorg-social-impact-bootcamp-nyc-registration-37716035678", | |
| "/Bootcamps": "https://www.dosomething.org/us/about/social-impact-bootcamp", | |
| "/Boss": "https://www.dosomething.org/us/campaigns/show-stress-whos-boss", | |
| } | |
| table redirect_types { | |
| "/Advocate": "301", | |
| "/After-School": "301", | |
| "/Amplify": "301", | |
| "/Andrea": "301", | |
| "/BootcampNYC": "301", | |
| "/Bootcamps": "301", | |
| "/Boss": "301", | |
| } | |
| sub vcl_recv { | |
| if (table.lookup(redirects, req.url)) { | |
| error 777 "Moved"; | |
| } | |
| } | |
| sub vcl_error { | |
| # Could be a 301 or 302 -- need to determine. Default to 302. | |
| if (obj.status == 777) { | |
| set obj.http.Location = table.lookup(redirects, req.url); | |
| set obj.status = std.atoi(table.lookup(redirect_types, req.url, "302")); | |
| return(deliver); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment