Skip to content

Instantly share code, notes, and snippets.

@abidtkg
Created August 17, 2023 10:05
Show Gist options
  • Save abidtkg/487c3e332fd41dbf47aff50df922667e to your computer and use it in GitHub Desktop.
Save abidtkg/487c3e332fd41dbf47aff50df922667e to your computer and use it in GitHub Desktop.
Angular htaccess config
Options FollowSymLinks ExecCGI
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
# If the requested file is not an existing directory or file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# need to add the ^4 in order to avoid triggering a loop
RewriteRule ^[^4]* /index.html [L,S=4000]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment