Skip to content

Instantly share code, notes, and snippets.

@clay584
Created April 12, 2018 20:26
Show Gist options
  • Select an option

  • Save clay584/293082ad54fae1e377c1710e3089472d to your computer and use it in GitHub Desktop.

Select an option

Save clay584/293082ad54fae1e377c1710e3089472d to your computer and use it in GitHub Desktop.
when HTTP_REQUEST {
# case sensitive
if { [HTTP::uri] contains "foo" } {
HTTP::respond 301 Location "https://[HTTP::host]/whatever"
}
# case insensitive
if { [string tolower [HTTP::uri]] contains "bar" } {
HTTP::respond 302 Location "https://[HTTP::host]/whatever"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment