mercredi 17 août 2016

Ember and htacess for Refreshing

I am working on an Ember 2.6 app and have hit a snag when it comes to refreshing the page. This looks to be a common issue so I have found and updated my .htaccess file as follow:

Options FollowSymLinks

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

So this works whenever I refresh on a URL like: http://ift.tt/2bIDH1f

However, it does not load whenever I refresh on: http://ift.tt/2b5maMS

Here is my router:

Router.map(function() {
  this.route('about');
  this.route('blogs');
  this.route('projects', function() {
      this.route('index', { path: '/' });
      this.route('project', { path: '/:project_id' });
  });
  this.route('error', { path: '*path' });
  this.route('loading');
});

And my route defining the model

model(params) {
    return this.store.findRecord('projects', params.project_id);
}

I'm not sure where this update would need to take place, htaccess or my router or what. Any help would be great. Thanks!




Aucun commentaire:

Enregistrer un commentaire