A better logic

A better logic for URL redirector