Static site generator Hugo doesn’t allow URLs without trailing slashes

1 Kudos

I checked out Hugo – a fast static site generator. Why use a static site generator? Because why would the server have to rebuild the page for every visitor instead of building it once? Especially, if content doesn’t change often. A static site generator compiles the website once and it’s served much faster to visitors.

Anyways, while Hugo seems like a great product, there’s one downside:

As of beginning of 2017, there is no support for removing trailing slashes from URLs, because every page generated by Hugo is a folder with an index.html. No mod_rewrite or anything.

The advantage is: Hugo-generated websites run on every webserver without hacks or additional configuration requirements.

But if you want to move your website from a CMS to a static Hugo-generated website and retain your current URL scheme, it won’t work out of the box.

The question now is: Why would you want to keep your exact URL scheme? Because sometimes, things might break if you don’t. Maybe local anchor links such as these might break – or not.

I use Piwik for web analytics and Piwik shows URLs with trailing slashes in a different way than URLs without a trailing slash. This even results in pages being counted as separate pages if a user visits or

Before you decide to use Hugo, think about whether or not control over trailing slashes are important to you or not.


Leave a Reply

Your email address will not be published. Required fields are marked *