[Solved] How do I make a default page for my website application with php?


To be true, I didn’t understand a reason why you want to do it, but anyway.

But if I were you, I would make next steps

  1. Configure Apache/Nginx/or what you’re using for your website/ to process all your request through your default page(index.php or something like that)

  2. In index.php you need to understand what page your user needs. If it doesn’t exist show him 404 page.

  3. If page exists and it’s not your default page, and user didn’t visit it before, redirect him there.
  4. In your default page, write to session e.g $_SESSION['passed_default'] = 1;

  5. Now, in your index.php you need to check

    if(isset($_SESSION['passed_default']) && $_SESSION['passed_default'])
    {
    //Show desired page
    }
    else
    {
    //redirect to default
    }

1

solved How do I make a default page for my website application with php?