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
-
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)
-
In index.php you need to understand what page your user needs. If it doesn’t exist show him 404 page.
- If page exists and it’s not your default page, and user didn’t visit it before, redirect him there.
-
In your default page, write to session e.g
$_SESSION['passed_default'] = 1;
-
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?