0

I converted my angular.js project to html5mode everything was working good until I tried to refresh my page. I did a little research and find out it is related to server-side.

I add <base href="/index.html"> to my index.html in head before everything.

Then add $locationProvider.html5Mode(true).hashPrefix('!'); to my app config.

And as suggested in other questions I added these lines to my .htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteRule ^(.*) /index.html [NC,L]

But my problem is continues.

What should I do ?

Suat Karabacak
  • 643
  • 2
  • 7
  • 24

1 Answers1

0

My problem has been solved with

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^/$
    RewriteRule (.*) /#!/$1 [NE,L,R=301]
</IfModule>
Suat Karabacak
  • 643
  • 2
  • 7
  • 24