PHP dosyası ise,
<?php
if(strpos($_SERVER['REQUEST_URI'], '?ref=')){
header("Location: index.php");
die();
}
?>
Şeklinde en üste ekleyebilirsiniz.