I created a new htaccess generator for angular apps that makes it easier for you to create the optimal htaccess file: https://julianpoemp.github.io/ngx-htaccess-generator/
The goal of this generator is to create the optimal .htaccess file for Angular apps easily. By default the generator creates an .htaccess file that solves the route redirection issue. To make it easier for you I created a kind of interview mode with some questions. As an additional feature the generator supports adding exclusions for example if you have installed a blog in a subdirectory of your web application and more!
The generator 😁: https://julianpoemp.github.io/ngx-htaccess-generator/
The project: https://github.com/julianpoemp/ngx-htaccess-generator
Place for issues and bug reports: https://github.com/julianpoemp/ngx-htaccess-generator/issues
If you have questions you can comment below. Please report bugs here.
Hey Julian, thanks for creating this! It helped me to figure out how to set up an Angular install with a Lumen rest api in a subfolder. I do have one issue that maybe you can help with, and might be a good addition to the generator? I've tried to turn off the Indexes throughout my server but for some reason it still wants to display the index of the api folder. Lumen has it's endpoint in a sub-sub folder /api/public so instead of just ignoring the folder I am rewriting to that directory using:
RewriteRule ^api/(.*)$ /api/public/$1 [L]
And above everything I also added
Options -Indexes
(which I've also added in the apache2.conf file and the sites-available conf file, and for those I also have the +FollowSymLinks after Options).
It shows the index when I go to
domain.com/api/
but not when I leave off the trailing / as indomain.com/api
so I feel like this is just a small typo - or I'm just going about doing this in the complete wrong way! Any advice?