We have and Angular app (front-end only) hosted on a CPanel hosting. I changed the .htaccess file to account for Angular routes.
RewriteOptions inherit
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
The problem is, when I add the code for redirecting to https, it shows the error 'too many redirects'. It seems that I can only have on of https and routes, despite both being very important. Also, I know that this question has been asked before, but the answer to that did not help me.
Also, I am open to using redirects or something else...
UPDATE
I changed the code to this:
RewriteOptions inherit
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^playbrackets\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.playbrackets\.com$
RewriteRule ^/?$ "https\:\/\/playbrackets\.com\/index.html" [R=301,L]
It redirects to https some of the times, especially in Incognito window, or when I clear the browser cache. It doesnt actually FORCE the redirection.

