1

I have been building a site with Grunt and grunt-contrib-connect.

I would like to have my site urls not require file extensions (i.e. 'foo' not 'foo.html')
From what I can gather gunt-contrib-connect does not pay attention to htaccess files so I can't define a mod rewrite there.

This seems to be possible with the use of middleware but I can't find any mention of how this is possible. Any help would be greatly appreciated.

    connect: {
        server: {
            options: {
                port: 9000,
                base: 'build/',
                livereload: true,
                open: true
            }
        }
    },
whmii
  • 430
  • 2
  • 10

1 Answers1

0

You need to the connect middleware to implement the rewrite rules, according to the connect documentation.

The grunt-connect-rewrite seems like the way to go you can find more information here: https://github.com/viart/grunt-connect-rewrite.

Here's the exact same question using the before mentioned implementation.

Removing file extension using grunt-contrib-connect and grunt-connect-rewrite

Community
  • 1
  • 1
Gotjosh
  • 1,019
  • 4
  • 13
  • 34