Skip to content

Instantly share code, notes, and snippets.

@mohammedmatar
Created May 27, 2019 03:31
Show Gist options
  • Select an option

  • Save mohammedmatar/14762ffd8bc34340dec1663c9ff75498 to your computer and use it in GitHub Desktop.

Select an option

Save mohammedmatar/14762ffd8bc34340dec1663c9ff75498 to your computer and use it in GitHub Desktop.
the only fucking working configuration to handle 404 error when deploying angular to apache, because there when you using angular router and you dont want to enable Hash Strategy you have to create .htaccess and add this fucking code to, plus if you have a ci, you will need to add .htaccess to be copied to the root directory.
<IfModule mod_rewrite.c>
Options Indexes FollowSymLinks
RewriteEngine On
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
@mohammedmatar
Copy link
Author

the only fucking working configuration to handle 404 error when deploying angular to apache, because there when you using angular router and you dont want to enable Hash Strategy you have to create .htaccess and add this fucking code to, plus if you have a ci, you will need to add .htaccess to be copied to the root directory.

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