For efficiency you might want to look into using .htaccess
In which you could obtain the refering domain using:
%{HTTP_referer}
If you have a separate .html file for each domain you could do something like:
Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http:[^.]+.([^.]+).co.uk/
RewriteRule /* http://www.domain.com/$1.html Or depending on what you're doing something like:
Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http:[^.]+.([^.]+).co.uk/
RewriteRule /* http://www.domain.com/parked.php?domain=$1
I've not tested the above but I know the idea works, the apache docs on this are:
http://httpd.apache.org/docs/mod/mod_rewrite.html