HTTP Redirects
Redirect to HTTPS
sub vcl_recv {
if (req.http.host == "www.transparentcdn.com") {
call redirect_https;
}
}Redirects 301 and 302
sub vcl_recv {
# 301
if (req.http.host == "example.com" && req.url ~ "^/old-section") {
# req.http.tcdn-location header is required for this call to work.
set req.http.tcdn-location = "301, https://www.example.com/new-section/";
call redirect_request;
}
# 302
if (req.http.host == "example.com" && req.url == "/") {
set req.http.tcdn-location = "302, https://www.example.com/es/";
call redirect_request;
}
}Last updated
Was this helpful?
