Properly get the correct initial path for redirects

and get it from the exported directory