Fixed URL rewriting Bug