Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
- $novaurl = str_replace("www.", "", $url);
- if (substr($_SERVER['HTTP_HOST'], 0, 4) === 'www.') {
- header('HTTP/1.1 301 Moved Permanently');
- header("Location: https://{$novaurl}");
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement