| 10 |
} |
} |
| 11 |
|
|
| 12 |
function toggle_www_redirect($method = 0) { |
function toggle_www_redirect($method = 0) { |
| 13 |
|
if ($_SERVER['HTTP_HOST'] == 'localhost') |
| 14 |
|
{ |
| 15 |
|
$method = 0; |
| 16 |
|
} |
| 17 |
// $method = 1 means redirect from www.example.com to example.com |
// $method = 1 means redirect from www.example.com to example.com |
| 18 |
if ($method == 1) { |
if ($method == 1) { |
| 19 |
if ( !strstr( $_SERVER['HTTP_HOST'], 'www.' )) // if its already example.com, take no action |
if ( !strstr( $_SERVER['HTTP_HOST'], 'www.' )) // if its already example.com, take no action |