Hello! I train with Angular, I set up the ui-router, everything was fine, I was happy with this creation. But I didn't like it:

/#/ 

Googling solved the question and now I have everything as it should and instead of /#/ on / .

But after, I ran into a problem, as soon as refreshing the page immediately gives an error 404, as if the wrong ways.

The site itself - http://lost-found-ua.esy.es/

this /#/ to this / decided like this:

 $locationProvider.html5Mode({ enabled: true, requireBase: false }); <head> <base href="/"> ... </head> 

Thanks in advance for your help.

    2 answers 2

    Found the solution - you need to add this code to the .htaccess file:

     RewriteEngine On # If an existing asset or directory is requested go to it as it is RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ - [L] # If the requested resource doesn't exist, use index.html RewriteRule ^ /index.html 

      You can lay out your full .htaccess file. Tried already a bunch of options, anyway, when rebooting on any of the steits, except for "/", it gives an error 500 Internal Server Error. Maybe this is a problem in the server? I do on a lokalka on OpenServer

      • one
        If this topic does not solve your problem, ask a new question and refer to the current one as interrelated. - 0xdb