Home

Awesome

Trailing Slash Guide

Have trailing slash problems after deploying a static website in production?

This repo explains factually the behavior of:

We also suggest some possible solutions

Intro

Let's get more familiar with trailing slash issues.

Common problems:

Causes:

Summary

Considering this static site:

static
│
├── file.html
│
├── folder
│   └── index.html
│
├── both.html
└── both
    └── index.html

Behavior of various static hosting providers:

HostSettingsUrl/file/file//file.html/folder/folder//folder/index.html/both/both//both.html/both/index.html
GitHub Pageslink💢 404➡️ /folder/
NetlifyDefault: Pretty Urls onlink➡️ /file➡️ /folder/➡️ /both
NetlifyPretty Urls offlink
VercelDefault: cleanUrls=false trailingSlash=undefinedlink💢 404💢 404
VercelcleanUrls=false trailingSlash=falselink💢 404💢 404➡️ /folder➡️ /both
VercelcleanUrls=false trailingSlash=truelink💢 404💢 404➡️ /folder/➡️ /both/
VercelcleanUrls=true trailingSlash=undefinedlink➡️ /file➡️ /folder➡️ /both➡️ /both
VercelcleanUrls=true trailingSlash=falselink➡️ /file➡️ /file➡️ /folder➡️ /folder➡️ /both➡️ /both➡️ /both
VercelcleanUrls=true trailingSlash=truelink➡️ /file/➡️ /file/➡️ /folder/➡️ /folder/➡️ /both/➡️ /both/➡️ /both/
Cloudflare Pageslink➡️ /file➡️ /file➡️ /folder/➡️ /folder/➡️ /both➡️ /both/
Renderlink
Azure Static Web Appslink➡️ /file

Help Wanted

Let's keep this resource up-to-date, and make it exhaustive together.