0

The result I wanted:

A user visits https://example.com/dir-one/dir-two/file.php But there is neither dir-one nor dir-two in main folder. But the browser show them the content described in /user/public_html/index.php (which shows as https://example.com/index.php) I imagined this code example for https://example.com/dir-one/dir-two/file.php

<?php
$uri = $_SERVER['REQUEST_URI']; // "/dir-one/dir-two/file.php"
if($uri == "/dirone/"){echo "you are in first dir i.e. dirone";}
if($uri == "/dirone/dirtwo/"){echo "you are in second dir i.e. dirtwo in dirone";}
if($uri == "/dirone/dirtwo/file.php"){echo "you are at file in second dir i.e. dirtwo in dirone";}
?>

Result:

you are at file in second dir i.e. dirtwo in dirone"
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Ahmed Raza
  • 39
  • 4

1 Answers1

0

You want to create a router.

See this