getIP and userAgent rewrite