Forked directory middleware to fix link paths and let us customize