Updated and completed template.php. redirect.php implemented