Is there a way to redirect people from a page on my .com website to a corresponding page on my .co.uk website if they are in the UK

Is there a way to redirect people from a page on my .com website to a corresponding page on my .co.uk website if they are in the UK

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)