我在网站上打开一些目录时遇到问题

When i open my directory listing in my website it shows me my login page for example i type www.site.com/assets/ its shows me my login page

here is the code in top my login page that looks like the problem

<?php
include('../server.php'); // my login code is in here
  error_reporting(0);
  if(isset($_SESSION['user'])){
      header('Location: dashboard');
  }
?>

and also id does in some directory also but when i login in my home page and visited the directories it shows my custom 404