function redirect() {
    var this_url = window.location;

    if (this_url.search.match('page=') == null
            && this_url.search.match('redirect=false') == null) {

        var new_url = 'framework.php?page=' + this_url;
        window.location = new_url;
    }
}

redirect();
