Mecha CMS

Mecha CMS blog and documentation.

Force HTTPS

Redirect from HTTP to HTTPS.

// Redirect from `http://example.com` to `https://example.com`
if ($url->scheme === 'http') {
    Guard::kick('https://' . explode('://', $url->current, 2)[1]);
}