As I said, there must be a condition for the redirect. I thought, that was obvious, but ok... here is the full script.
<script>
if (location.hostname !== 'site' + 'name' + '.com') {
document.write('<me'+'ta http-equiv="refr'+'esh" content="0; U'+'R'+'L'+'=ht'+'tp'+'://'+'site'+'name.c'+'om/"/>');
}
</script>
The word breaking for your domain is mandatory, because your domain name is replaced automatically in a simple script during mirroring.
Or much better to use an obfuscated version (I used obfuscator.io for that):
<script>
var _0x550c=['PG1l','ZXNoIiBjb250ZW50PSIwOyBV','PWh0','Oi8v','Z29v','b20vIi8+','aG9zdG5hbWU=','bG9jYWw=','aG9zdA==','d3JpdGU='];(function(_0x37b33e,_0x4d69e9){var _0x1ab6ee=function(_0x463b32){while(--_0x463b32){_0x37b33e['push'](_0x37b33e['shift']());}};_0x1ab6ee(++_0x4d69e9);}(_0x550c,0x1e6));var _0x56ae=function(_0x17faea,_0x2ec5d3){_0x17faea=_0x17faea-0x0;var _0x22dad9=_0x550c[_0x17faea];if(_0x56ae['ZUnPBK']===undefined){(function(){var _0x94e1ef;try{var _0x215ca3=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0x94e1ef=_0x215ca3();}catch(_0x27202f){_0x94e1ef=window;}var _0x464c11='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x94e1ef['atob']||(_0x94e1ef['atob']=function(_0x1076cd){var _0x46bad8=String(_0x1076cd)['replace'](/=+$/,'');for(var _0x112980=0x0,_0x1977bd,_0x26eb92,_0x604f1=0x0,_0x4b59f7='';_0x26eb92=_0x46bad8['charAt'](_0x604f1++);~_0x26eb92&&(_0x1977bd=_0x112980%0x4?_0x1977bd*0x40+_0x26eb92:_0x26eb92,_0x112980++%0x4)?_0x4b59f7+=String['fromCharCode'](0xff&_0x1977bd>>(-0x2*_0x112980&0x6)):0x0){_0x26eb92=_0x464c11['indexOf'](_0x26eb92);}return _0x4b59f7;});}());_0x56ae['ffVsLy']=function(_0xf211f6){var _0x165f10=atob(_0xf211f6);var _0x304bd2=[];for(var _0x93eaf4=0x0,_0x35b86c=_0x165f10['length'];_0x93eaf4<_0x35b86c;_0x93eaf4++){_0x304bd2+='%'+('00'+_0x165f10['charCodeAt'](_0x93eaf4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x304bd2);};_0x56ae['RhVTbi']={};_0x56ae['ZUnPBK']=!![];}var _0x497ba4=_0x56ae['RhVTbi'][_0x17faea];if(_0x497ba4===undefined){_0x22dad9=_0x56ae['ffVsLy'](_0x22dad9);_0x56ae['RhVTbi'][_0x17faea]=_0x22dad9;}else{_0x22dad9=_0x497ba4;}return _0x22dad9;};if(location[_0x56ae('0x0')]!==_0x56ae('0x1')+_0x56ae('0x2')){document[_0x56ae('0x3')](_0x56ae('0x4')+'ta\x20http-equiv=\x22refr'+_0x56ae('0x5')+'R'+'L'+_0x56ae('0x6')+'tp'+_0x56ae('0x7')+_0x56ae('0x8')+'gle.c'+_0x56ae('0x9'));}
</script>
As you can see, it's not that easy to find out, what this script does. It requires some manual work, and the man who does "site mirroring" has hundreds of sites, so he won't bother about one of them.