When i go to http://localhost:3000/SahanpCMS/resources/ , it shows directory listings. how can i stop this and redirect to 404 page?
Asked
Active
Viewed 4,667 times
0
Saeed Vaziry
- 1,975
- 4
- 22
- 38
-
just put an index.html file or use .htaccess file – Vinod VT Nov 19 '15 at 11:25
-
you can also add `-Indexes` to your .htaccess – Sergio Ivanuzzo Nov 19 '15 at 11:27
-
actually i moved entire of public folder to root folder and changed ``index.php`` file. now i have problem with ``.htaccess`` file – Saeed Vaziry Nov 19 '15 at 11:29
1 Answers
4
Add .htaccess file to the root of your project and add the following to it.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Basit
- 908
- 5
- 11
-
-
i moved all files in public folder to root folder. so i want to disallow all folders in root. – Saeed Vaziry Nov 19 '15 at 12:21