In this article, we will explain how to redirect HTTP traffic to HTTPS while using the StackPath SecureCDN and WAF enabled. There are a few "gotcha's involved, so please be sure to read closely!
On SecureCDN sites with WAF enabled, EdgeRules only apply to file types that are included in the WAF aggressive caching list. All other requests are filtered by the WAF and passed back to the origin server.
HTTP to HTTPS redirection with WAF will only work for the root domain and will stop working if you try to modify the redirection with additional rules.
e.g. you may not redirect http://domain.om to https://www.domain.com
- Log into the StackPath control panel and navigate to the Site where you want to set up redirection.
- Under CDN, choose EdgeRules from the sidebar menu
- Select Add New Rule and chose Force HTTPS Connections
- In the create EdgeRule screen, ensure that the Match Type is set to Default and Select +Create