How to setup force requests redirection from http to https?
http://www.domain.com/something → https://www.domain.com/something
How to setup force requests redirection from http to https?
http://www.domain.com/something → https://www.domain.com/something
If you are using the CDN-as-Code approach, you can create a rule to match by scheme and redirect the request to https
:
import { Router } from '@edgio/core/router';
export default new Router()
.match(
{ scheme: "HTTP" },
{
comment: "redirect http requests to https",
url: {
url_redirect: { source: "(.*)", destination: "https://$1", code: 302 },
},
}
)
If using the Rules UI, that may look something like this:
Not working. Incorrect Location: https:///
.