I am using <a href="file:...">
links inside an Intranet for local folder access.
What bothers me is the amount of slashes I have to write in those URI for cross-browser compatibility.
Internet Explorer 11.904.16299.0
file://server/share/path/to/file ok
file:///server/share/path/to/file not working
file:////server/share/path/to/file ok
file://///server/share/path/to/file ok
Edge 41.16299.820.0
file://server/share/path/to/file ok
file:///server/share/path/to/file not working
file:////server/share/path/to/file ok
file://///server/share/path/to/file ok
Firefox 60.0 with Local Filesystem Links Extension
file://server/share/path/to/file not working
file:///server/share/path/to/file not working
file:////server/share/path/to/file not working
file://///server/share/path/to/file ok
When I look for answers in Stack Overflow or similar, I end up in those posts, saying that the correct amount is 3 slashes.
- https://superuser.com/questions/352133/why-do-file-urls-start-with-3-slashes
- Why does http:// contain two slashes and file:/// three in a browser navigation bar?
I write this question and answer it in case someone gets confused like I did.