If you only want your visitors to reach a certain page by way of your domain (certain forms etc...) then this domain validation script might help you out
Or you can use the below code to generate the error page: