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 5,218 times
1

Saeed Vaziry
- 2,195
- 5
- 26
- 39
-
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
5
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
- 936
- 5
- 13
-
-
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