1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #3197 closed

Static file directories should append trailing slash to URL (BB-2909)

Kevin Burke
created an issue

On my static site server, kevinburke.bitbucket.org/markdowncss and kevinburke.bitbucket.org/markdowncss/

go to two separate places. This violates my expectation (and is hurting my Google search traffic for "markdown css"). I also tried adding a static file called markdowncss that would add a 301 redirect to the directory with the trailing slash, but it looks like you can't have a file and a directory with the same name together (at least easily).

In nginx, it looks like you have to add this setting:

{{{ rewrite ^(.*[^/])$ $1/ permanent; }}}

to append the trailing slash to URL's that don't already have it. For more see this Stackoverflow question at http://stackoverflow.com/questions/645853/add-slash-to-the-end-of-every-url-need-rewrite-rule-for-nginx.

Comments (4)

  1. Log in to comment