I'd like to get this straighten out once and for all:
<?php if ($_SERVER['HTTP_HOST'] != 'domain.com'){
header("Location: http://domain.com"
.$_SERVER['REQUEST_URI']);
} ?>
This will send all traffic to the NON-WWW version.
My question is - can I add 'header('HTTP/1.1 301 Moved Permanently');' safely without messing everything up?
I'm using IIS server so .htaccess is no good and all pages are coded in PHP - all solutions welcome.