Hello all i am having a website in which i have many directories like members/images/emotions and other php files like index.php,login.php,profile.php... etc in the directory/folder images all the imgeas of wbsite is stored and i do not want people to look into it. currenlty when we type www.sitedomain.com index.php is shown which is ok but when we type www.sitedomain.com/images all the images link are shown i dont want any people to look into this folder . a default 404 eror page should be displayed
You could add a .htaccess
file in the folder with the following line in it:
Options -Indexes
Or (if your site doesn't run on Apache or you don't have override permission)
index.html
file in the folderOr
put an index.php
file in the folder with the line:
<?php header('Location: some-other-page.html');
Upload a file called 'index.html' to the directory 'images'. Your server is displaying this message because it is unsure which file is the index file.
Below is a template for your html file:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>404 Error</title>
</head>
<body>
<p>404 - Page not found</p>
</body>
</html>