0

My Index file

 <base href="/"/>

In my controller added $Locatonprovider and redirect like this

 $location.path('/ui-login');

$locationProvider.html5Mode(true);

.htaccess file

      RewriteEngine On

      # if an existing  asset or directory is requested go to it  as          it is 
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^ - [L]

      # if the requested resource doesn't exist, use index.html
      RewriteRule ^ /index.html

my URL

http://localhost/index.html

note: it's work but the problem was when I refresh the page get error 404 file not found

Output:

enter image description here

8
  • Have you confirmed that your HTTP server has htaccess support turned on? Why are you even using htaccess? The manual says you should avoid them almost at the very top of the page. Commented Sep 19, 2018 at 12:51
  • This file or directory exists. You probably have here directory named ui-login. Commented Sep 19, 2018 at 12:51
  • @Quentin I was trying to remove a .htaccess file and many sites and blogs suggested to add .htaccess file so but it's same error and thx for the response Commented Sep 19, 2018 at 12:54
  • 2
    @Rushidave — Client-side JavaScript can't help if the page won't load in the first place Commented Sep 19, 2018 at 12:55
  • 1
    @Rushidave — Why? There's nothing more to say. Commented Sep 19, 2018 at 13:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.