function uriMissingTrailingSlash(u){
	var regex = /\/$/;
	var extRegex = /\/(.)*\.(.)+$/;	
	if ( regex.test( u ) || extRegex.test( u ) ) {
				return false;
	} else {
				return true;
	}
}

if ( uriMissingTrailingSlash( document.location.pathname ) ) {
        location.replace(document.location.pathname + "/" + document.location.search );
}
