Limit open redirecton in redirect.py to enhance security

- The value of the location request parameter is used to perform an HTTP redirect, this will cause a redirection to other website URL by attacker. So limit the open redirection in same domain.

- It will print an error/warning message that may disclose sensitive information like the location of the file that produced the unhandled exception. This information can be used to launch further attacks against the web application. Add try catch to avoid print sensitive information.