If you can find a way to do it, just add the following peice of PHP code to your scripts so that it's loaded on every page and before any content is sent to the browser:
Code:
if ( substr( $_SERVER['HTTP_HOST'], 0, 4 ) != 'www.' ) {
header( 'HTTP/1.0 301 Moved Permanently' );
header( 'Location: http://www.' . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'] );
} Keep in mind that if you do this, you will be redirecting every one of your users every time they click on a link (if what you say is true). I would recommend reversing it. Redirecting all users to a non "www" URL:
Code:
if ( substr( $_SERVER['HTTP_HOST'], 0, 4 ) == 'www.' ) {
header( 'HTTP/1.0 301 Moved Permanently' );
header( 'Location: http://' . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'] );
} I'm gonna poke around the apache documentation. I think there's a way to do this with mod_rewrite.
Bookmarks