Решение для Preact с preact-router
Работает с обновлением и прямым доступом
Для тех, кто обнаруживает это через Google, вот демо истории preact-router + hash:
const { h, Component, render } = preact; /** @jsx h */
const { Router } = preactRouter;
const { createHashHistory } = History;
const App = () => (
all paths in preact-router are still /normal/urls.
using hash history rewrites them to /#/hash/urls
Example: page 2
);