ehm you shouldn't include any html tags there, make it like this.
edit: nevermind this, it's VBulletin adding the html tags even when outputing PHP code.
PHP Code:
<?
if (strstr($_SERVER['HTTP_REFERER'], "amateur")) { header("Location: http://www.mydomain.com/amateur.html"); };
?>
also any output command such as echo/print being executed before your re-direct will cause it to fail. so make sure there is nothing in your script that outputs info before it's supposed to re-direct.