I have some php code that says if index.php or main root then display some code and if not then show other code and it works on index.php but if it's just the domain name without index.php at the end, it don't work. I have the following code at the moment
<?php $currentpage = $_SERVER['REQUEST_URI'];
if($currentpage=='/' || $currentpage=="/index.php" || $currentpage=="index.php" || $currentpage=="" ) {
?>
Can anyone help me out please as I don't know what to amend for the code to work if main root and not have index.php at the end, the code should be the same for the main root / and index.php