Fixing URL rewriting