Added redirection in rules file instead of script.