Fortinet white logo
Fortinet white logo

Script Reference Guide

Redirect HTTP to HTTPS

Redirect HTTP to HTTPS

You can redirect an HTTP request from an HTTP location to an HTTPS location.

Redirect an HTTP request to HTTPS location:
when HTTP_REQUEST{
Host = HTTP:header_get_value("host")
Url = HTTP:uri_get()
HTTP:redirect("https://%s%s", Host, Url)
}

Redirect HTTP to HTTPS

Redirect HTTP to HTTPS

You can redirect an HTTP request from an HTTP location to an HTTPS location.

Redirect an HTTP request to HTTPS location:
when HTTP_REQUEST{
Host = HTTP:header_get_value("host")
Url = HTTP:uri_get()
HTTP:redirect("https://%s%s", Host, Url)
}