Q: Page not found when refreshed on SailsJS I'm buidling an app on sails and I am using it with angularjs. My problem is that everytime that I refresh a page it shows page not found. In apache I can fix it using this htaccess:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)       /index.php/#/$1 
</IfModule>

How can I implement this on sails

A: I have a possible solution to this on another question, basically a Sails controller version of the mod_rewrite snippet you posted.

A: I've found that there's two ways of doing this. 
Single Entrypoint
This method is much easier to maintain, but it may not work for everyone. If you have multiple angularjs apps, you will have to use the second method or a hybrid approach.
If you prefer to have a single angularjs entrypoint, and you're ok with it being in a subpath, its easy with the following setup:
In config/routes.js add the single catch-all route:
//wildcard catchall for angularjs entrypoint.
'/app/*': 'AngularController.index',

and have an angularJS app.js that looks like the following:
.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
    $routeProvider.when('/app/user', {templateUrl: '/angular/application/views/settings/user.html', controller: 'settingsUserCtrl'});
    $routeProvider.when('/app/tags/:tagId', {
        templateUrl: '/angular/application/views/tags/tag.html',
        controller: 'tagListCtrl',
        reloadOnSearch: true
    });
    $routeProvider.otherwise({redirectTo: '/app/user'});
    ...
}])

Now load a page on a browser that points to /app/anything. it loads the AngularJS index page, at which point the AngularJS ngRoute plugin loads the correct content. 
Multiple Entrypoint/Sails Controllers
In config/routes.js you can add multiple routes, that match Sails Controllers, which will match AngularJS apps/controllers
'/user/*': 'UserController.index',
'/tag/*': 'TagController.index',

and use the following in your angular app.js
.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
    $routeProvider.when('/user', {templateUrl: '/angular/application/views/settings/user.html', controller: 'settingsUserCtrl'});
    $routeProvider.when('/tags/:tagId', {
        templateUrl: '/angular/application/views/tags/tag.html',
        controller: 'tagListCtrl',
        reloadOnSearch: true
    });
    $routeProvider.otherwise({redirectTo: '/app/user'});
    ...
}])

