I have deployed angular 8 project in linux sub domain (web.mydomain.com), but when I am accessing web.mydomain.com directory listing is showing instead of loading website, but when I am accessing http://web.mydomain.com/index.html it is working.
Below is the htaccess file looks like :
JavaScript
x
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^(.*)$ index.html
Advertisement
Answer
Add following line in your htaccess
JavaScript
Options -Indexes
Either you may try
JavaScript
<VirtualHost *:80>
DocumentRoot /home/user/www
ServerName myserver.local
<Directory /home/user/www/>
Options FollowSymLinks MultiViews
</Directory>
<Directory /home/user/www/appdir3>
Options Indexes
</Directory>
</VirtualHost>