eregi() è stato deprecato, puoi usare un if normale no?

Codice PHP:
if ("sql.php" == $_SERVER['PHP_SELF']) {  
header("Location: index.php");