Anyone who wants to SEO optimize their website or blog knows that they need to redirect all users to the same place so that search engines don't come up with duplicate information. It's very easy to do with .htaccess files, but if you aren't able to make those, you can also do it with PHP.
$site = "mysite.com";
if(strpos($_SERVER['HTTP_HOST'], "www.") !== 0){
header("Location: http://www." . $site . $_SERVER['REQUEST_URI']);
}
Just change the $site variable, put it in the header of your site, and you're done ![]()



