php $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $params = $_GET; $target = ""; // utils function delAndGetQuery($delArray){ $params = $_GET; foreach ($delArray as $key) { unset($params[$key]); } return http_build_query($params); } // 跳转 if (preg_match('#^/([A-z-]+/)?blu-ray-cinavia-removal-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}blu-ray-cinavia-removal" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?video-converter-ultimate-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}video-converter-ultimate" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?video-converter-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}video-converter" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?tunescopy-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}tunescopy" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?tunes-cleaner-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}tunes-cleaner" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?photoins-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}photoins" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?photo-enhancer-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}photo-enhancer" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?music-recorder-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}music-recorder" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?itransfer-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}itransfer" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } if (preg_match('#^/([A-z-]+/)?ios-data-recovery-mac((?:/(.*))|/)?$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}ios-data-recovery" . ($matches[2] ?? '') . '?sys=mac' . ($query ? '&'.$query : ''); } ##### if (preg_match('#^/jp/video-converter-mac/user-guide.html$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}video-converter/user-guide.html?sys=mac" . ($query ? '&'.$query : ''); } if (preg_match('#^/jp/video-converter-ultimate-mac/user-guide.html$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}video-converter-ultimate/user-guide.html?sys=mac" . ($query ? '&'.$query : ''); } if (preg_match('#^/jp/blu-ray-cinavia-removal-mac/user-guide.html$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}blu-ray-cinavia-removal/user-guide.html?sys=mac" . ($query ? '&'.$query : ''); } if (preg_match('#^/jp/blu-ray-cinavia-removal-mac/tech-spec.html$#', $path, $matches)) { $query = delAndGetQuery(['sys']); $target = "/{$matches[1]}blu-ray-cinavia-removal/tech-spec.html?sys=mac" . ($query ? '&'.$query : ''); } // 返回 if($target !== '') { header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $target); exit; } http_response_code(404); echo '404 Not Found'; exit;