<? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?>
You can create .php file by using this code.
$ourFileName = "testFile.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fclose($ourFileHandle);
Not if you want an immediate redirect, no. (GA often takes many seconds to respond with a 200 OK.) You can do local PHP-based logging, though, to capture much of that data; and GA on the target page should give you relevant referer (original page request) info.