1

I was able to successfully deploy my web app in apache server(wamp) locally. So initially my URL looks like http://somehost.com/dshrestha/ and I can navigate to various routes for eg. http://somehost.com/dshrestha/home, http://somehost.com/dshrestha/contact etc via navigation links but then when I refresh the page on any of the routes, I get 404 Not Found error.

How can I overcome this issue? i even tried to redirect all requests to index.html by creating htaccess file but no luck. Thanks.

Deewendra Shrestha
  • 2,313
  • 1
  • 23
  • 53

3 Answers3

2

I had the same problem, but I found the solution in the next answer:

https://stackoverflow.com/a/28630973/4425050

Change the locationType from auto --> to hash

Community
  • 1
  • 1
Vinicio Ajuchan
  • 342
  • 1
  • 9
1

Ok turned out it was an .htaccess thing I had to fix. Added these in my .htaccess to get things working

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !(?=jpg|png|gif|js|css|pdf|docx|htm)
RewriteRule ^(.*)$ index.html
Deewendra Shrestha
  • 2,313
  • 1
  • 23
  • 53
0

its an old post, however, to make sure you can use bootstrap glyphicon and any other file that pg|png|gif|js|css|pdf|docx|htm, replace

RewriteCond %{REQUEST_FILENAME} !(?=jpg|png|gif|js|css|pdf|docx|htm)

with this

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f