The first RewriteCond allows requests for files which already exists, The second RewriteCond allowed requests for directories which already exists, The third RewriteCond makes sure to not redirect any of the data, html, css or js directories

The first RewriteRule says that if any of the RewriteCond matched, we do not do anything else (i.e. return from this function) The second RewriteRule says that if we have not returned from the previous RewriteRule we will return index.html instead of what was requested (which makes html5mode work)

# For angular html5mode

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 [OR]
RewriteCond %{REQUEST_URI} ^/(data|html|css|js)/
RewriteRule ^ - [L]

# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html