Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Optimal .htaccess configuration for Angular 12, Angular 11, Angular 10, Angular 9, Angular 8, Angular 7, Angular 6, Angular 5 (and older) app in production incl. fix for the angular browser caching issue.

New generator

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 to 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

@benzdouglas
Copy link

benzdouglas commented Mar 24, 2022

You're a genius! That looks to have worked, thanks! Would have taken me a long time to find that missing character

@MincDev
Copy link

MincDev commented Apr 21, 2022

This is awesome. Can you also make it do redirection to www? I had to add this manually, but would save me time if you had this as part of your generator :)

@julianpoemp
Copy link
Author

julianpoemp commented Apr 21, 2022

@MincDev nice idea! I'll add it asap 🙂

@julianpoemp
Copy link
Author

julianpoemp commented Aug 8, 2022

@MincDev I added an option for redirection to www :)

@MincDev
Copy link

MincDev commented Aug 8, 2022

@MincDev I added an option for redirection to www :)

Great stuff! Thanks @julianpoemp!

@Ronaldy-Alves
Copy link

Ronaldy-Alves commented Aug 29, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment