Eddie Eddie - 21 days ago 5
PHP Question

PHP - if page is index.php redirect to index.php?page=something

Is it possible to redirect

index.php
to
index.php?page=something
? Every attempt I've made so far causes a redirect loop.

Answer

You could try this:

index.php

<?php
if(!isset($_GET["page"])){
    header("Location: index.php?page=something");
    exit;
}
?>