I'm trying to remove '.html' from files in my grunt web app.
http://testing.com/one/ should return index.html from that folder, but if there is no trailing slash (http://testing.com/one) it should check for one.html
The grunt-connect-rewrite seems to be working fine with examples that I can find, but removing file extensions from .html files seems to be killing me. The rule here is one similar to what i'd use in an .htaccess file.
connect: {
server: {
options: {
port: 9000,
keepalive: true,
base: 'dist',
middleware: function(connect, options) {
return [
rewriteRulesSnippet,
// Serve static files
connect.static(require('path').resolve(options.base))
];
}
},
rules: {
'^(.*)\.html$': '/$1'
}
}
}
So the question is, what is the correct rule to use here?