This guide will show how to configure domain redirection from one to another. This particular feature is useful to redirect apex/naked domains to www e.g. domain.com => www.domain.com.
Before you can use Fastly Edge Modules you need to make sure they are enabled
When you click on the configuration you will be prompted with a screen like this
You can specify multiple domain redirects by clicking Add Group button
Incoming domain e.g. domain.com
Destination domain/host e.g. www.domain.com
Strip incoming path and set it to /. Default only rewrites host retaining the path e.g. http://domain.com/category is redirected to https://www.domain.com/category
After any change to the settings you need to click Upload as that will activate the functionality you configured.
Following VCL snippets are being uploaded
Snippet Type: vcl_recv
if (req.http.host == "domain.com") {
set req.http.host = "www.domain.com";
set req.url = "/";
error 801;
}
Snippet Type: vcl_recv
if (req.http.host == "domain.com") {
set req.http.host = "www.domain.com";
error 801;
}