var osProtocol = (("https:" == document.location.protocol) ? "https://" : "http://");
var strURL = location.href;
var bRedirect = false;
if ( location.href.search(/index.(html|htm|php)/i) > -1 ) {
	strURL = strURL.replace(/index.(html|htm|php)/i,'');
	bRedirect = true;
}
if ( document.domain.slice(0,4) !== 'www.') {
	strURL = strURL.replace(osProtocol,osProtocol+'www.');
	bRedirect = true;
}
if (bRedirect) {
	location.href = strURL;
}
