Mecha CMS

Code snippet collection for developers.

Addon Domain Redirection

Author: Taufik Nurrohman · 58 Views

Tweet

Redirect from base domain to alternate domain with PHP.

// Redirect from `http://example-1.com/dir/*` to `http://example-2.com/*`
if ($url->host === 'example-1.com' && $url->directory === 'dir') {
    Guardian::kick($url->protocol . 'example-2.com/' . $url->path);
}

0 Comments

No comments yet.