Dinamically rewrites a URL using regular expressions.