Fixed security method so that the referrer check will work with clean
urls.