Due to the current [[ https://forge.softwareheritage.org/source/swh-web/browse/master/swh/web/browse/views/origin.py$24-29 | URL regexps ordering ]] for browsing a directory in a context of a snapshot or an origin, trying to browse a directory named 'directory' returns a 404, see https://archive.softwareheritage.org/browse/origin/http://snapshot.debian.org/package/texlive-extra//directory/texmf-dist/tex/latex/directory/ for instance.
Changing the ordering of the URL regexps declaration should be sufficient to fix that issue.