.htaccess redirects not working with Angular 4

后端 未结 1 1734
情书的邮戳
情书的邮戳 2021-01-13 12:27

I know a lot of people ask this, but I have looked at all the answers and nothing is working.

I am sure the problem is I need to create a .htaccess file and add it t

相关标签:
1条回答
  • 2021-01-13 12:36

    After making a big fuss with the technical team of my hosting provider, they confirmed my .htaccess file was not being uploaded via my FTP client. It looks like I should have added it to the dist folder after the build. The code for the .htaccess file they added is just the same as one of the versions I tried before and it works fine:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.html$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.html [L]
    </IfModule>
    
    0 讨论(0)
提交回复
热议问题